Example #1
0
int main(int argc, char *argv[])
{
    KAboutData aboutData("PTT", 0, ki18n("Plasma Theme Tester"),
                         "0.1", ki18n("Description"), 
                         KAboutData::License_GPL,
                         ki18n("(c) 2008  Riccardo Iaconelli"), 
                         KLocalizedString(), "", "*****@*****.**");
    aboutData.addAuthor(ki18n("Riccardo Iaconelli"), KLocalizedString(), "*****@*****.**");

    KCmdLineArgs::init(argc, argv, &aboutData);

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs::parsedArgs();
    KApplication app;

    Ui::MainWindow ui;
    KMainWindow *mw = new KMainWindow;
    ui.setupUi(mw);

// set all the properties...
    ui.background->setType("background");

    mw->show();

    return app.exec();
}
Example #2
0
File: main.cpp Project: nemasu/qkgr
int
main(int argc, char *argv[])
{
	QString user = qgetenv("USER");
	if ( user != "root" ) {
		cerr << "qkgr must be run with root privileges, please use \"gksu qkgr\"." << endl;
		return -1;
	}

    QApplication app(argc, argv);
    QMainWindow *mainWindow = new QMainWindow;
    Ui::MainWindow ui;
    ui.setupUi(mainWindow);

    mainWindow->show();

	ui.tableWidget->setColumnCount(4);

	QStringList headerLabels;
	headerLabels << "Name" << "Version" << "Installed" << "Description";
	ui.tableWidget->setHorizontalHeaderLabels(headerLabels);

	foreach( QString pkg, PkgInfo::GetPkgList() ) {
		cerr << "Adding " << pkg.toStdString() << endl;
		addPkgDetailToTable(ui.tableWidget, PkgInfo::GetPkgDetail(pkg));
	}
Example #3
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QMainWindow w;
    Ui::MainWindow u;
    u.setupUi(&w);
    w.show();
    return a.exec();
}
Example #4
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QMainWindow *widget = new QMainWindow;
    Ui::MainWindow ui;
    ui.setupUi(widget);
    widget->setCentralWidget(new ECanvas());
    widget->show();
    return a.exec();
}
Example #5
0
int main(int argc, char **argv) {
  int retval;
  QApplication app(argc, argv);
  Ui::MainWindow* window = new Ui::MainWindow(0);
  window->setupUi(window);
  window->setWindowTitle("OpenCV --> QtImage");
  window->show();
  retval = app.exec();
  return retval;
}
Example #6
0
int main( int argc, char **argv )
{
  QApplication app(argc, argv);
  QMainWindow *widget = new QMainWindow;
  Ui::MainWindow ui;
  ui.setupUi(widget);
  
  QObject::connect( ui.pushButton, SIGNAL(clicked()), ui.label, SLOT(setText(const QString&)) );
  
  widget->show();
  return app.exec();
}
Example #7
0
int main(int argc, char** argv) {
    Q_INIT_RESOURCE(textures);

    QApplication a(argc, argv);

    QSurfaceFormat format; 
    format.setVersion(3,3);
    format.setProfile(QSurfaceFormat::CoreProfile);
    QSurfaceFormat::setDefaultFormat(format);

    QMainWindow *window = new QMainWindow;
    Ui::MainWindow ui;
    ui.setupUi(window);

    window->show();

    return a.exec();
}
Example #8
0
int main(int argc, char *argv[])
{
    ros::init(argc, argv, "RoboticanGuiNode");
    ros::AsyncSpinner spinner(1);
    spinner.start();

    QApplication app(argc, argv);
    QMainWindow widget;
    Ui::MainWindow win;
    win.setupUi(&widget);

    GUImanager gui(widget, win, app);
    gui.startGUI();

    widget.show();
    app.exec();
    return 0;
}
Example #9
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QMainWindow *window = new QMainWindow;
    Ui::MainWindow ui;
    ui.setupUi(window);

    std::string fileName;
	float scale;
    float radius;
    int dims;
    if(argc > 1){
        fileName = argv[1];
    }else{
        fileName = "cat.off";
    }

    if(argc > 2){
        scale = atof(argv[2]);
    }else{
        scale = 1;
    }
    if(argc > 3){
        radius = atof(argv[3]);
    }else{
        radius = 1.0;
    }if(argc > 4){
        dims = atoi(argv[4]);
    }else{
        dims = 10;
    }

    ui.glWidget->setFilename(fileName,scale, radius, dims);
    window->show();
    //GLWidget window;

    //window.resize(800,600);
    //window.show();

    return app.exec();
}
int main(int argc, char *argv[]){

  QApplication app(argc, argv); // QApplication - Qt trida, app jeji instance (=konkretni objekt), vzdy (asi) se ji pri volani predavaji argv, argc (tj. vlastne inicializace toho objektu app) 
  QMainWindow *window = new QMainWindow; // window je ukazatel na instanci tridy QMainWindow... new je zase inicializace noveho objektu 
  Ui::MainWindow ui; // Ui a MainWindow - viz ui_main.h, :: -> je clenem, ui je objekt tridy MainWindow
  ui.setupUi(window); // volani metody setupUi() tridy Ui_MainWindow -> nastaveni ui, jako parametr prebira ukazatel na QMainWindow... 
    // ui je nase rozhrani, ktere popisuje jednotlive komponenty (tlacitka, displej, ..., okno)
    // window je instance (prazdneho) okna
    // metoda setupUi() sestavuje nase rozhrani (vytvari a nastavuje tlacitka jakozto objekty,... a nastavuje okno) [resp. vklada tlacitka apod. (=widgety) do okna-window]
    // ___________

    



  
  window->show(); // zobrazeni okna
  
  return app.exec(); // nekonecna smycka zajistujici interakci.. program <-> ui <-> uzivatel... {uzivatel zada akci, vyhodnoceni akce} porad dokola... pokud akce nebyla Quit 
}
Example #11
0
int main(int argv, char** argc)
{
  QApplication app(argv, argc);

  qApp->setOrganizationName("CTK");
  qApp->setOrganizationDomain("commontk.org");
  qApp->setApplicationName("ctkExampleHost");

  ctkPluginFrameworkFactory fwFactory;
  QSharedPointer<ctkPluginFramework> framework = fwFactory.getFramework();

  try
    {
    framework->init();
    }
  catch (const ctkPluginException& exc)
    {
    qCritical() << "Failed to initialize the plug-in framework:" << exc;
    return EXIT_FAILURE;
    }

#ifdef CMAKE_INTDIR
  QString pluginPath = qApp->applicationDirPath() + "/../plugins/" CMAKE_INTDIR "/";
#else
  QString pluginPath = qApp->applicationDirPath() + "/plugins/";
#endif

  qApp->addLibraryPath(pluginPath);

  QStringList libFilter;
  libFilter << "*.dll" << "*.so" << "*.dylib";
  QDirIterator dirIter(pluginPath, libFilter, QDir::Files);

  QStringList pluginsToInstall;
  pluginsToInstall << "org_commontk_dah_core" << "org_commontk_dah_host"
                   << "org_commontk_dah_examplehost";

  QList<QSharedPointer<ctkPlugin> > installedPlugins;
  while(dirIter.hasNext())
    {
    try
      {
      QString fileLocation = dirIter.next();
      foreach(QString pluginToInstall, pluginsToInstall)
        {
        if (fileLocation.contains(pluginToInstall))
          {
          QSharedPointer<ctkPlugin> plugin = framework->getPluginContext()->installPlugin(QUrl::fromLocalFile(fileLocation));
          installedPlugins << plugin;
          break;
          }
        }
      }
    catch (const ctkPluginException& e)
      {
      qCritical() << e.what();
      }
    }

  framework->start();

  foreach(QSharedPointer<ctkPlugin> plugin, installedPlugins)
    {
    plugin->start();
    }

  QMainWindow mainWindow;
  Ui::MainWindow ui;
  ui.setupUi(&mainWindow);
  if ( QApplication::argc() > 1 )
    {
    ui.controlWidget->setAppFileName(QApplication::argv()[1]);
    }

//  mainWindow.addDockWidget(static_cast<Qt::DockWidgetArea>(4),new ctkHostAppExampleWidget());

//  QVBoxLayout* layout = new QVBoxLayout(&mainWindow);

//  ctkHostAppExampleWidget* placeholder = new ctkHostAppExampleWidget(&mainWindow);

//  layout->addWidget(placeholder);
  mainWindow.show();

  return app.exec();
}
Example #12
0
Main::Main(QWidget *parent) :
CoastalMain()
{
    ui.setupUi((QMainWindow *)this);
    status(tr("loading..."));

    indexData = NULL;
    index_validator = new ValidateIndex;

    program_name = "Coastal Manpager";
    program_about = "Coastal Manual Page Viewer";

    QWidget *toolbar = extendToolbar(ui.toolBar);
    tb.setupUi(toolbar);

    QSettings settings;
    resize(settings.value("size", QSize(760, 540)).toSize());

#ifdef Q_OS_WIN
    const char *separator = ";";
    QString manpath = settings.value("manpath").toString();
    if(manpath.isEmpty())
        manpath = "C:\\tools\\man";
#else
    const char *separator = ":";
    QString manpath = getenv("MANPATH");
    if(manpath.isEmpty())
        manpath = settings.value("manpath").toString();

    if(manpath.isEmpty())
        manpath = "/usr/share/man:/usr/local/share/man";
#endif

    manpaths = manpath.split(separator, QString::SkipEmptyParts);

    sections[0] = ui.actionSection1;
    sections[1] = ui.actionSection2;
    sections[2] = ui.actionSection3;
    sections[3] = ui.actionSection4;
    sections[4] = ui.actionSection5;
    sections[5] = ui.actionSection6;
    sections[6] = ui.actionSection7;
    sections[7] = ui.actionSection8;
    sections[8] = ui.actionSectionl;
    sections[9] = ui.actionSectionn;

    settings.beginGroup("Sections");
    ui.actionSection1->setChecked(settings.value("1", ui.actionSection1->isChecked()).toBool());
    ui.actionSection2->setChecked(settings.value("2", ui.actionSection2->isChecked()).toBool());
    ui.actionSection3->setChecked(settings.value("3", ui.actionSection3->isChecked()).toBool());
    ui.actionSection4->setChecked(settings.value("4", ui.actionSection4->isChecked()).toBool());
    ui.actionSection5->setChecked(settings.value("5", ui.actionSection5->isChecked()).toBool());
    ui.actionSection6->setChecked(settings.value("6", ui.actionSection6->isChecked()).toBool());
    ui.actionSection7->setChecked(settings.value("7", ui.actionSection7->isChecked()).toBool());
    ui.actionSection8->setChecked(settings.value("8", ui.actionSection8->isChecked()).toBool());
    ui.actionSectionl->setChecked(settings.value("l", ui.actionSectionl->isChecked()).toBool());
    ui.actionSectionn->setChecked(settings.value("n", ui.actionSectionn->isChecked()).toBool());
    settings.endGroup();

    searchGroup = new QActionGroup(this);
    ui.actionIndex->setActionGroup(searchGroup);
    ui.actionKeywords->setActionGroup(searchGroup);

    ui.indexView->setEnabled(false);
    ui.indexView->setShowGrid(false);
    ui.indexView->setSortingEnabled(false);
    ui.indexView->setSelectionBehavior(QAbstractItemView::SelectRows);
    ui.indexView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    ui.indexView->setSelectionMode(QAbstractItemView::SingleSelection);
    ui.indexView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    ui.indexView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui.indexView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(open(const QPoint&)));

    // menu action signals

    connect(ui.actionOptions, SIGNAL(triggered()), this, SLOT(options()));
    connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(about()));
    connect(ui.actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(ui.actionReload, SIGNAL(triggered()), this, SLOT(reload()));
    connect(ui.actionSupport, SIGNAL(triggered()), this, SLOT(support()));

    connect(ui.actionAll, SIGNAL(triggered()), this, SLOT(all()));
    connect(ui.actionClear, SIGNAL(triggered()), this, SLOT(clear()));

    for(unsigned pos = 0; pos < 10; ++pos)
        connect(sections[pos], SIGNAL(triggered()), this, SLOT(reload()));

    // input validation

    tb.searchBox->setValidator(index_validator);

    // forms, tabs, and view signals

    connect(tb.searchBox, SIGNAL(editTextChanged(const QString&)), this, SLOT(search(const QString&)));
    connect(tb.searchBox, SIGNAL(activated(const QString&)), this, SLOT(load(const QString&)));
    connect(ui.tabs, SIGNAL(tabCloseRequested(int)), this, SLOT(close(int)));
    connect(ui.indexView, SIGNAL(activated(const QModelIndex&)), this, SLOT(load(const QModelIndex&)));
    connect(ui.actionView, SIGNAL(triggered()), this, SLOT(view()));
    connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(open()));

    // application signals

    connect(this, SIGNAL(resized()), this, SLOT(columns()));
    connect(this, SIGNAL(startup()), this, SLOT(reload()), Qt::QueuedConnection);

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(menu(const QPoint&)));

    emit startup();
}
Example #13
0
Main::Main(const char *prefix) :
CoastalMain()
{
    ui.setupUi((QMainWindow *)this);
    ui.statusbar->showMessage(tr("loading..."));

    program_name = "Coastal Search";
    program_about = "Coastal File Search Utility";

    QWidget *toolbar = extendToolbar(ui.toolBar);
    tb.setupUi(toolbar);

    ind = NULL;

    if(prefix)
        QDir::setCurrent(prefix);

    dir.setPath(QDir::currentPath());
    history.append(dir.path());

    QSettings settings;
    resize(settings.value("size", QSize(760, 540)).toSize());

    if(settings.value("case", false).toBool())
        casefilter = true;

    if(settings.value("text", false).toBool())
        CoastalView::setSensitive();

    if(types) {
        ui.filterTypes->setText(types);
        ui.filterTypes->setEnabled(false);
    }
    else {
        QString filter = settings.value("filter", ".txt;.log").toString();
        ui.filterTypes->setText(filter);

        int paths = settings.beginReadArray("paths");
    //  qDebug() << "SIZE " << paths << endl;
        for(int path = 0; path < paths; ++path) {
            settings.setArrayIndex(path);
            QString temp = settings.value("path").toString();
    //      qDebug() << "STR " << path << " VALUE " << temp << endl;
            if(temp == dir.path())
                continue;
            history.append(temp);
        }
        settings.endArray();
    }

    ui.indexView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui.indexView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(open(const QPoint&)));

    connect(ui.actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(about()));
    connect(ui.actionClear, SIGNAL(triggered()), this, SLOT(clear()));
    connect(ui.actionSearch, SIGNAL(triggered()), this, SLOT(reload()));
    connect(ui.actionOptions, SIGNAL(triggered()), this, SLOT(options()));
    connect(ui.actionSupport, SIGNAL(triggered()), this, SLOT(support()));
    connect(ui.pathButton, SIGNAL(clicked()), this, SLOT(changeDir()));
    connect(ui.pathBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectDir(int)));

    connect(tb.searchText, SIGNAL(returnPressed()), this, SLOT(reload()));
    connect(ui.searchName, SIGNAL(returnPressed()), this, SLOT(reload()));
    connect(ui.filterTypes, SIGNAL(returnPressed()), this, SLOT(reload()));

    connect(ui.tabs, SIGNAL(tabCloseRequested(int)), this, SLOT(close(int)));
    connect(ui.indexView, SIGNAL(activated(const QModelIndex&)), this, SLOT(open(const QModelIndex&)));

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(menu(const QPoint&)));

    connect(ui.actionView, SIGNAL(triggered()), this, SLOT(view()));
    connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(open()));

    // adding history triggers selectDir...
    ui.pathBox->addItems(history);

    clear();
}