SweetDisplayStandby::SweetDisplayStandby(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::SweetDisplayStandby)
{

    displayWasDimmed = false;
    displayWasTurnedOff = false;
    forceDisplayTurnOff = false;
    turnOffHotKeyId = 1;
    restoreHotKeyId = 2;
    lastInputTime = 0;
    const GUID GUID_DEVINTERFACE_MONITOR = {0xe6f07b5f, 0xee97, 0x4a90, 0xb0, 0x76, 0x33, 0xf5, 0x7b, 0xf4, 0xea, 0xa7};


    ui->setupUi(this);

    appIcon = QIcon(":/main/icon.png");

    QStringList arguments = QCoreApplication::arguments();
    createTrayIcon();
    setWindowFlags(Qt::WindowTitleHint | Qt::WindowSystemMenuHint |Qt:: WindowMinimizeButtonHint | Qt::WindowCloseButtonHint  | Qt::MSWindowsFixedSizeDialogHint );

    QCoreApplication::setOrganizationName("Vavooon");
    QCoreApplication::setApplicationName("SweetDisplayStandby");
    settings = new QSettings();
    displayDimTime = settings->value("dimTime", 30).toInt();
    displayOffTime = settings->value("turnOffTime", 3*60).toInt();
    normalBrightnessLevel = settings->value("normalBrightnessLevel", 60).toInt();
    dimmedBrightnessLevel = settings->value("dimmedBrightnessLevel", 0).toInt();
    enableBrighnessManagement = settings->value("enableBrighnessManagement", true).toBool();
    autoStartup = settings->value("autoStartup", false).toBool();
    showTrayIcon = settings->value("showTrayIcon", true).toBool();
    runMinimized = settings->value("runMinimized", true).toBool();
    turnOffSequence = QKeySequence( settings->value("turnOffSequence", "Ctrl+F1").toString() );
    restoreSequence = QKeySequence( settings->value("restoreSequence", "Ctrl+F12").toString() );

    ui->dimTimeInput->setValue( displayDimTime );
    ui->turnOffTimeInput->setValue( displayOffTime );
    ui->normalBrightnessLevelInput->setValue( normalBrightnessLevel );
    ui->dimmedBrightnessLevelInput->setValue( dimmedBrightnessLevel );
    ui->brightnessStateCheckBox->setChecked( enableBrighnessManagement );
    ui->brightnessGroupBox->setEnabled(enableBrighnessManagement);
    ui->dimTimeInput->setEnabled(enableBrighnessManagement);
    ui->startupCheckBox->setChecked(autoStartup);
    ui->trayCheckBox->setChecked(showTrayIcon);
    ui->minimizedCheckBox->setChecked(runMinimized);

    ui->statusBar->showMessage("Display is active");

    connect( ui->actionAbout, SIGNAL(triggered(bool)), this, SLOT(aboutPopup()));
    connect( ui->actionProjectSite, SIGNAL(triggered(bool)), this, SLOT(openSite()) );
    connect( ui->actionExit, SIGNAL(triggered(bool)), this, SLOT( exit() ) );

    connect( ui->dimTimeInput, SIGNAL(valueChanged(int)), this, SLOT( onDimTimeChange(int)) );
    connect( ui->turnOffTimeInput, SIGNAL(valueChanged(int)), this, SLOT( onTurnOffTimeChange(int)) );
    connect( ui->normalBrightnessLevelInput, SIGNAL( valueChanged(int)), this, SLOT(onNormalBrightnessLevelChange(int)) );
    connect( ui->dimmedBrightnessLevelInput, SIGNAL( valueChanged(int)), this, SLOT(onDimmedBrightnessLevelChange(int)) );
    connect( ui->brightnessStateCheckBox, SIGNAL(toggled(bool)), this, SLOT(onBrightnessStateChange(bool)) );
    connect( ui->startupCheckBox, SIGNAL(toggled(bool)), this, SLOT(onStartupCheckBox(bool)) );
    connect( ui->trayCheckBox, SIGNAL(toggled(bool)), this, SLOT(onTrayCheckBox(bool)) );
    connect( ui->minimizedCheckBox, SIGNAL( toggled(bool)), this, SLOT(onMinimizeCheckBox(bool)) );
//    connect( ui->allDisplaysRadio, SIGNAL(toggled(bool)), ui->displaysList, SLOT(setEnabled(bool)) );

    connect( ui->turnOffSequenceEdit, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(updateTurnOffSequence(QKeySequence)) );
    connect( ui->restoreSequenceEdit, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(updateRestoreSequence(QKeySequence)) );

    ui->turnOffSequenceEdit->setKeySequence(turnOffSequence);
    ui->restoreSequenceEdit->setKeySequence(restoreSequence);

    EnumDisplayMonitors(0, 0, EnumProc, 0);


    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
    ZeroMemory(&NotificationFilter, sizeof(NotificationFilter));

    NotificationFilter.dbcc_size = sizeof(NotificationFilter);
    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_reserved = 0;

    NotificationFilter.dbcc_classguid = GUID_DEVINTERFACE_MONITOR;

    RegisterDeviceNotification((HWND)SweetDisplayStandby::winId(),&NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE );



    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(timerTick()));
    timer->setInterval(100);
    timer->start();

    QTimer *tickTimer = new QTimer(this);
    tickTimer->setInterval(1000);
    connect(tickTimer, SIGNAL(timeout()), this, SLOT(queueTimerTick()));
    tickTimer->start();

    addToQueue("turnOn");
    addToQueue("illuminate");


    if (showTrayIcon)
    {
        trayIcon->show();
    }

    if (!runMinimized)
    {
        show();
    }
}
Пример #2
0
DialogNewWebIO::DialogNewWebIO(Room *r, int item, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogNewWebIO), io(NULL), room(r), item(item)
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    ui->setupUi(this);
    QString label;

    //hide error labels by default.
    ui->label_error_empty->hide();
    ui->label_error_path_empty->hide();
    ui->label_error_url_empty->hide();

    ui->label_value_off->hide();
    ui->label_value_on->hide();
    ui->edit_value_off->hide();
    ui->edit_value_on->hide();

    analogWidget= nullptr;
    // Set default combo type value
    switch (item)
      {
      case ITEM_INPUT_SWITCH:
        ui->io_type->setCurrentIndex(0);
        label = tr("Create an new Web Input Switch");
        break;
      case ITEM_LIGHT:
        ui->io_type->setCurrentIndex(1);
        ui->label_value_off->show();
        ui->label_value_on->show();
        ui->edit_value_off->show();
        ui->edit_value_on->show();
        label = tr("Create an new Web Light");
        break;
      case ITEM_LIGHT_RGB:
        ui->io_type->setCurrentIndex(2);
        label = tr("Create an new Web RGB Light");
        break;
      case ITEM_SHUTTER:
        ui->io_type->setCurrentIndex(3);
        label = tr("Create an new Web Shutter");
        break;
      case ITEM_TEMP:
        ui->io_type->setCurrentIndex(4);
        label = tr("Create an new Web Temperature Input");
        analogWidget = new FormAnalogProperties(this, false);
        ui->verticalLayout_3->insertWidget(1, analogWidget);
        break;
      case ITEM_ANALOG:
        ui->io_type->setCurrentIndex(5);
        label = tr("Create an new Web Analog Input");
        analogWidget = new FormAnalogProperties(this, false);
        ui->verticalLayout_3->insertWidget(1, analogWidget);
        break;
      case ITEM_STRING:
        if (type.find("Input") != string::npos)
        {
          ui->io_type->setCurrentIndex(7);
          label = tr("Create an new Web String Input");
        }
        else
        {
          ui->io_type->setCurrentIndex(8);
          label = tr("Create an new Web String Output");
        }
        break;
      default:
        break;
      }

    ui->io_type_label->hide();
    ui->io_type->hide();

    ui->groupBox->setTitle(label);
}
Пример #3
0
SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) :
    QWidget(0, f), curAlignment(0)
{

    // transparent background
    setAttribute(Qt::WA_TranslucentBackground);
    setStyleSheet("background:transparent;");

    // no window decorations
    setWindowFlags(Qt::FramelessWindowHint);

    // set reference point, paddings
    int paddingLeft             = 14;
    int paddingTop              = 470;
    int titleVersionVSpace      = 17;
    int titleCopyrightVSpace    = 32;

    float fontFactor            = 1.0;

    // define text to place
    QString titleText       = tr("Dash Core");
    QString versionText     = QString(tr("Version %1")).arg(QString::fromStdString(FormatFullVersion()));
    QString copyrightTextBtc   = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers"));
    QString copyrightTextDash   = QChar(0xA9)+QString(" 2014-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Dash Core developers"));
    QString titleAddText    = networkStyle->getTitleAddText();
    // networkstyle.cpp can't (yet) read themes, so we do it here to get the correct Splash-screen
    QString splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash";
    if(GetBoolArg("-regtest", false))
        splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash_testnet";
    if(GetBoolArg("-testnet", false))
        splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash_testnet";

    QString font = QApplication::font().toString();

    // load the bitmap for writing some text over it
    pixmap = QPixmap(splashScreenPath);

    QPainter pixPaint(&pixmap);
    pixPaint.setPen(QColor(100,100,100));

    // check font size and drawing with
    pixPaint.setFont(QFont(font, 28*fontFactor));
    QFontMetrics fm = pixPaint.fontMetrics();
    int titleTextWidth  = fm.width(titleText);
    if(titleTextWidth > 160) {
        // strange font rendering, Arial probably not found
        fontFactor = 0.75;
    }

    pixPaint.setFont(QFont(font, 28*fontFactor));
    fm = pixPaint.fontMetrics();
    titleTextWidth  = fm.width(titleText);
    pixPaint.drawText(paddingLeft,paddingTop,titleText);

    pixPaint.setFont(QFont(font, 15*fontFactor));
    pixPaint.drawText(paddingLeft,paddingTop+titleVersionVSpace,versionText);

    // draw copyright stuff
    pixPaint.setFont(QFont(font, 10*fontFactor));
    pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace,copyrightTextBtc);
    pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace+12,copyrightTextDash);

    // draw additional text if special network
    if(!titleAddText.isEmpty()) {
        QFont boldFont = QFont(font, 10*fontFactor);
        boldFont.setWeight(QFont::Bold);
        pixPaint.setFont(boldFont);
        fm = pixPaint.fontMetrics();
        int titleAddTextWidth  = fm.width(titleAddText);
        pixPaint.drawText(pixmap.width()-titleAddTextWidth-10,pixmap.height()-25,titleAddText);
    }

    pixPaint.end();

    // Resize window and move to center of desktop, disallow resizing
    QRect r(QPoint(), pixmap.size());
    resize(r.size());
    setFixedSize(r.size());
    move(QApplication::desktop()->screenGeometry().center() - r.center());

    subscribeToCoreSignals();
}
Пример #4
0
PreFlightWeatherPage::PreFlightWeatherPage( QWidget *parent ) :
  QWidget(parent),
  m_downloadManger(0),
  m_updateIsRunning(false),
  NoMetar(tr("No METAR available")),
  NoTaf(tr("No TAF available"))
{
  setObjectName("PreFlightWeatherPage");
  setWindowTitle(tr("METAR and TAF"));
  setWindowFlags( Qt::Tool );
  setWindowModality( Qt::WindowModal );
  setAttribute(Qt::WA_DeleteOnClose);

  if( MainWindow::mainWindow() )
    {
      // Resize the window to the same size as the main window has. That will
      // completely hide the parent window.
      resize( MainWindow::mainWindow()->size() );

#ifdef ANDROID
      // On Galaxy S3 there are size problems observed
      setMinimumSize( MainWindow::mainWindow()->size() );
      setMaximumSize( MainWindow::mainWindow()->size() );
#endif
    }

  QVBoxLayout *mainLayout  = new QVBoxLayout( this );
  m_listWidget             = new QWidget( this );
  m_displayWidget          = new QWidget( this );
  m_editorWidget           = new QWidget( this );

  mainLayout->addWidget( m_listWidget );
  mainLayout->addWidget( m_displayWidget );
  mainLayout->addWidget( m_editorWidget );

  m_displayWidget->hide();
  m_editorWidget->hide();

  //----------------------------------------------------------------------------
  // List widget
  //----------------------------------------------------------------------------
  QVBoxLayout *listLayout = new QVBoxLayout( m_listWidget );

  m_list = new QTreeWidget;
  m_list->setRootIsDecorated( false );
  m_list->setItemsExpandable( false );
  m_list->setSortingEnabled( true );
  m_list->setSelectionMode( QAbstractItemView::SingleSelection );
  m_list->setSelectionBehavior( QAbstractItemView::SelectRows );
  m_list->setAlternatingRowColors(true);
  m_list->setColumnCount( 1 );
  m_list->setFocusPolicy( Qt::StrongFocus );
  m_list->setUniformRowHeights(true);
  m_list->setHeaderLabel( tr( "METAR and TAF" ) );

  m_list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  m_list->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );

#ifdef ANDROID
  QScrollBar* lvsb = m_list->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture(m_list->viewport(), QScroller::LeftMouseButtonGesture);
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture(m_list->viewport(), QtScroller::LeftMouseButtonGesture);
#endif

  listLayout->addWidget( m_list );

  QHBoxLayout* hbbox1 = new QHBoxLayout;
  listLayout->addLayout( hbbox1 );

  QPushButton* cmd = new QPushButton(tr("Add"), this);
  hbbox1->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowAirportEditor()));

  hbbox1->addSpacing( 10 );

  m_listUpdateButton = new QPushButton(tr("Update"), this);
  hbbox1->addWidget(m_listUpdateButton);
  connect (m_listUpdateButton, SIGNAL(clicked()), SLOT(slotRequestWeatherData()));

  hbbox1->addSpacing( 10 );

  cmd = new QPushButton(tr("Details"), this);
  hbbox1->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotDetails()));

  QHBoxLayout* hbbox2 = new QHBoxLayout;
  listLayout->addLayout( hbbox2 );

  cmd = new QPushButton(tr("Delete"), this);
  hbbox2->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotDeleteAirport()));

  hbbox2->addSpacing( 10 );

  cmd = new QPushButton(tr("Close"), this);
  hbbox2->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotClose()));

  //----------------------------------------------------------------------------
  // Display widget for report details
  //----------------------------------------------------------------------------
  QVBoxLayout *displayLayout = new QVBoxLayout( m_displayWidget );
  m_display = new QTextEdit;
  m_display->setReadOnly( true );

#ifdef ANDROID
  lvsb = m_display->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture(m_display->viewport(), QScroller::LeftMouseButtonGesture);
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture(m_display->viewport(), QtScroller::LeftMouseButtonGesture);
#endif

  displayLayout->addWidget( m_display );

  QHBoxLayout* hbbox = new QHBoxLayout;
  displayLayout->addLayout( hbbox );

  m_detailsUpdateButton = new QPushButton(tr("Update"));
  hbbox->addWidget(m_detailsUpdateButton);
  connect (m_detailsUpdateButton, SIGNAL(clicked()), SLOT(slotRequestWeatherData()));

  hbbox->addSpacing( 10 );

  cmd = new QPushButton(tr("Close"));
  hbbox->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowListWidget()));

  //----------------------------------------------------------------------------
  // Editor widget for station adding.
  //----------------------------------------------------------------------------
  QVBoxLayout *editorLayout = new QVBoxLayout( m_editorWidget );

  editorLayout->addWidget( new QLabel(tr("Airport ICAO Code")), 0, Qt::AlignLeft );

  QHBoxLayout *inputLayout = new QHBoxLayout;
  editorLayout->addLayout( inputLayout );

  QRegExpValidator* eValidator = new QRegExpValidator( QRegExp( "[a-zA-Z0-9]{4}|^$" ), this );

  Qt::InputMethodHints imh;
  m_airportEditor = new QLineEdit;
  m_airportEditor->setInputMethodHints(Qt::ImhUppercaseOnly | Qt::ImhDigitsOnly | Qt::ImhNoPredictiveText);
  m_airportEditor->setValidator( eValidator );

  connect( m_airportEditor, SIGNAL(returnPressed()),
           MainWindow::mainWindow(), SLOT(slotCloseSip()) );

  inputLayout->addWidget( m_airportEditor, 5 );
  inputLayout->addSpacing( 10 );

  cmd = new QPushButton(tr("Cancel"), this);
  inputLayout->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowListWidget()));

  inputLayout->addSpacing( 10 );

  cmd = new QPushButton(tr("Ok"), this);
  inputLayout->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotAddAirport()));

  editorLayout->addStretch( 10 );

  //----------------------------------------------------------------------------
  loadAirportData( true );
  show();
}
Пример #5
0
void MainWindow::init()
{
    setWindowFlags(Qt::WindowCloseButtonHint);
    streetViewManager.reset(new StreetViewManager(ui));
}
Пример #6
0
MainWindow::MainWindow( QWidget *parent )
:	QWidget( parent )
,	cardsGroup( new QActionGroup( this ) )
{
	setAttribute( Qt::WA_DeleteOnClose, true );
	setupUi( this );

	cards->hide();
	cards->hack();
	languages->hack();

	setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint );
#if QT_VERSION >= 0x040500
	setWindowFlags( windowFlags() | Qt::WindowCloseButtonHint );
#else
	setWindowFlags( windowFlags() | Qt::WindowSystemMenuHint );
#endif

	// Buttons
	QButtonGroup *buttonGroup = new QButtonGroup( this );

	buttonGroup->addButton( settings, HeadSettings );
	buttonGroup->addButton( help, HeadHelp );
	buttonGroup->addButton( about, HeadAbout );

	buttonGroup->addButton( homeCreate, HomeCreate );
	buttonGroup->addButton( homeView, HomeView );

	introNext = introButtons->addButton( tr( "Next" ), QDialogButtonBox::ActionRole );
	buttonGroup->addButton( introNext, IntroNext );
	buttonGroup->addButton( introButtons->button( QDialogButtonBox::Cancel ), IntroBack );

	viewCrypt = viewButtons->addButton( tr("Encrypt"), QDialogButtonBox::ActionRole );
	buttonGroup->addButton( viewCrypt, ViewCrypt );
	buttonGroup->addButton( viewButtons->button( QDialogButtonBox::Close ), ViewClose );
	connect( buttonGroup, SIGNAL(buttonClicked(int)),
		SLOT(buttonClicked(int)) );

	connect( cards, SIGNAL(activated(QString)), qApp->poller(), SLOT(selectCard(QString)), Qt::QueuedConnection );
	connect( qApp->poller(), SIGNAL(dataChanged()), SLOT(showCardStatus()) );

	// Cryptodoc
	doc = new CryptoDoc( this );

	// Translations
	lang << "et" << "en" << "ru";
	retranslate();
	QActionGroup *langGroup = new QActionGroup( this );
	for( int i = 0; i < lang.size(); ++i )
	{
		QAction *a = langGroup->addAction( new QAction( langGroup ) );
		a->setData( lang[i] );
		a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_0 + i );
	}
	addActions( langGroup->actions() );
	connect( langGroup, SIGNAL(triggered(QAction*)), SLOT(changeLang(QAction*)) );
	connect( cardsGroup, SIGNAL(triggered(QAction*)), SLOT(changeCard(QAction*)) );

	// Views
	connect( viewContentView, SIGNAL(remove(int)),
		SLOT(removeDocument(int)) );
	connect( viewContentView, SIGNAL(save(int,QString)),
		doc, SLOT(saveDocument(int,QString)) );
}
Пример #7
0
QScreenScallingWin::QScreenScallingWin(QWidget* parent) : QMainWindow(parent)
{
    app_settings settings;
    setWindowFlags(Qt::FramelessWindowHint);   
    setFocusPolicy(Qt::NoFocus);
    setObjectName("scalling_window");
    
    sel_bit = 1;
    //musimy ustawic okno jako nieprzeźroczyste - białe tło
    QPalette transparentPallete;
    transparentPallete.setColor(QPalette::Window, QColor(255, 255, 255, 255));
    //transparentPallete.setBrush(QPalette::Background,*(new QBrush(*(new QPixmap(QString::fromUtf8(":/img/scr_adj.png"))))));
    setPalette(transparentPallete);
    
    adj_buttons[1] = new QLabel(this);
    adj_buttons[1]->setGeometry(452,(332),120,80);
    adj_buttons[1]->setText("sdsdd");
    adj_buttons[1]->setObjectName("simple_label");
    adj_buttons[1]->setAlignment(Qt::AlignCenter);
    adj_buttons[1]->setPixmap(QPixmap(":/img/Przesuniecie.xpm"));
 //   adj_buttons[1]->image (*new xpmImage(Przesuniecie_xpm));

    adj_buttons[0] = new QLabel(this);
    adj_buttons[0]->setGeometry(472,(adj_buttons[1]->y()-160),80,80);
    adj_buttons[0]->setText("\u25b3");
    adj_buttons[0]->setObjectName("simple_label");
    adj_buttons[0]->setAlignment(Qt::AlignCenter);


    adj_buttons[2] = new QLabel(this);
    adj_buttons[2]->setGeometry(472,(adj_buttons[1]->y()+160),80,80);
    adj_buttons[2]->setText("\u25bd");
    adj_buttons[2]->setObjectName("simple_label");
    adj_buttons[2]->setAlignment(Qt::AlignCenter);
  //  adj_buttons[2]->image (*new xpmImage(mainmenu_arrowdown_xpm));



    adj_buttons[3] = new QLabel(this);
    adj_buttons[3]->setGeometry((adj_buttons[1]->x()-160),adj_buttons[1]->y(),80,80);
    adj_buttons[3]->setText("\u25c1");
    adj_buttons[3]->setObjectName("simple_label");
    adj_buttons[3]->setAlignment(Qt::AlignCenter);
 //   adj_buttons[3]->image (*new xpmImage(mainmenu_arrow_left_xpm));


    adj_buttons[4] = new QLabel(this);
    adj_buttons[4]->setGeometry((adj_buttons[1]->x()+180),adj_buttons[1]->y(),80,80);
    adj_buttons[4]->setText("\u25b7");
    adj_buttons[4]->setObjectName("simple_label");
    adj_buttons[4]->setAlignment(Qt::AlignCenter);
 //   adj_buttons[4]->image (*new xpmImage(mainmenu_arrow_right_xpm));
    
    show();
    
    adj_buttons[0]->setFont(QFont( "Arial", 50, QFont::Normal));
    adj_buttons[1]->setFont(QFont( "Arial", 50, QFont::Normal));
    adj_buttons[2]->setFont(QFont( "Arial", 50, QFont::Normal));
    adj_buttons[3]->setFont(QFont( "Arial", 50, QFont::Normal));
    adj_buttons[4]->setFont(QFont( "Arial", 50, QFont::Normal));
    
    setGeometry(0,0,1024,768);
    via_fd=-1;
    connect(parentWidget(),SIGNAL(sigMenuAction(int)),this,SLOT(doSigMenuAction(int)));
    via_connect();
    
    volatile uint32_t via_data = settings.getViaSettings();
    
    if(via_data!=0)
    {
        h_diff = ((via_data & 0x0000ff00)>>8);
        panel_h_temp = 576 - h_diff;
     //   printf("panel_h_temp:%d\n",panel_h_temp);
    }
ccCurvatureDlg::ccCurvatureDlg(QWidget* parent/*=0*/) : QDialog(parent), Ui::CurvatureDialog()
{
	setupUi(this);

	setWindowFlags(Qt::Tool/*Qt::Dialog | Qt::WindowStaysOnTopHint*/);
}
Пример #9
0
UIProgressDialog::UIProgressDialog(CProgress &progress,
                                   const QString &strTitle,
                                   QPixmap *pImage /* = 0 */,
                                   bool fSheetOnDarwin /* = false */,
                                   int cMinDuration /* = 2000 */,
                                   QWidget *pParent /* = 0 */)
  : QIDialog(pParent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint)
  , m_progress(progress)
  , m_pImageLbl(0)
  , m_pCancelBtn(0)
  , m_fCancelEnabled(false)
  , m_cOperations(m_progress.GetOperationCount())
  , m_iCurrentOperation(m_progress.GetOperation() + 1)
  , m_fEnded(false)
{
    setModal(true);

    QHBoxLayout *pLayout0 = new QHBoxLayout(this);

#ifdef Q_WS_MAC
    /* No sheets in another mode than normal for now. Firstly it looks ugly and
     * secondly in some cases it is broken. */
    if (   fSheetOnDarwin
        && vboxGlobal().isSheetWindowsAllowed(pParent))
        setWindowFlags(Qt::Sheet);
    ::darwinSetHidesAllTitleButtons(this);
    ::darwinSetShowsResizeIndicator(this, false);
    if (pImage)
        pLayout0->setContentsMargins(30, 15, 30, 15);
    else
        pLayout0->setContentsMargins(6, 6, 6, 6);
#else
    NOREF(fSheetOnDarwin);
#endif /* Q_WS_MAC */

    if (pImage)
    {
        m_pImageLbl = new QILabel(this);
        m_pImageLbl->setPixmap(*pImage);
        pLayout0->addWidget(m_pImageLbl);
    }

    QVBoxLayout *pLayout1 = new QVBoxLayout();
    pLayout1->setMargin(0);
    pLayout0->addLayout(pLayout1);
    pLayout1->addStretch(1);
    m_pDescriptionLbl = new QILabel(this);
    pLayout1->addWidget(m_pDescriptionLbl, 0, Qt::AlignHCenter);

    QHBoxLayout *pLayout2 = new QHBoxLayout();
    pLayout2->setMargin(0);
    pLayout1->addLayout(pLayout2);

    m_progressBar = new QProgressBar(this);
    pLayout2->addWidget(m_progressBar, 0, Qt::AlignVCenter);

    if (m_cOperations > 1)
        m_pDescriptionLbl->setText(QString(m_spcszOpDescTpl)
                                   .arg(m_progress.GetOperationDescription())
                                   .arg(m_iCurrentOperation).arg(m_cOperations));
    else
        m_pDescriptionLbl->setText(QString("%1 ...")
                                   .arg(m_progress.GetOperationDescription()));
    m_progressBar->setMaximum(100);
    setWindowTitle(QString("%1: %2").arg(strTitle, m_progress.GetDescription()));
    m_progressBar->setValue(0);
    m_fCancelEnabled = m_progress.GetCancelable();
    if (m_fCancelEnabled)
    {
        m_pCancelBtn = new UIMiniCancelButton(this);
        m_pCancelBtn->setFocusPolicy(Qt::ClickFocus);
        pLayout2->addWidget(m_pCancelBtn, 0, Qt::AlignVCenter);
        connect(m_pCancelBtn, SIGNAL(clicked()), this, SLOT(cancelOperation()));
    }

    m_pEtaLbl = new QILabel(this);
    pLayout1->addWidget(m_pEtaLbl, 0, Qt::AlignLeft | Qt::AlignVCenter);

    pLayout1->addStretch(1);

    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    retranslateUi();

    /* The progress dialog will be shown automatically after
     * the duration is over if progress is not finished yet. */
    QTimer::singleShot(cMinDuration, this, SLOT(showDialog()));
}
Пример #10
0
void ccCameraParamEditDlg::makeFrameless()
{
	setWindowFlags(Qt::FramelessWindowHint |Qt::Tool);
}
Пример #11
0
About::About(QWidget *parent, QString language) : QDialog(parent)
{
	_language = language;
	// Setup UI:
	setupUi(this);
#ifdef SMALL_RESOLUTION
	// https://bugreports.qt.io/browse/QTBUG-16034
	// Workaround for window not showing always fullscreen
	setWindowFlags( Qt::Window );
#endif
	// Display title/program version:
	progversion_label->setText(progversion_label->text() + " " + QApplication::applicationVersion());
	// Load licence text and changelog:
	QFile changelog_file;
	if (language == "de")
		changelog_file.setFileName(":/changelog_de.txt");
	else
		changelog_file.setFileName(":/changelog_en.txt");
	changelog_file.open(QIODevice::ReadOnly | QIODevice::Text);
	QString changelog_content = static_cast<QString>(changelog_file.readAll());
	changelog_textBrowser->setText(changelog_content);
	changelog_file.close();
	// *** Definitions:
	SSMprotocol2_def_en ssmp_defs;
	// Display number of supported DTCs:
	int nrofDTCs_SUB = ssmp_defs.SUBDTCrawDefs().size();
	int nrofDTCs_OBD = ssmp_defs.OBDDTCrawDefs().size();
	int nrofDTCs_CC = ssmp_defs.CCCCrawDefs().size();
	QString dtcstr = QString::number( nrofDTCs_SUB ) + " / " + QString::number( nrofDTCs_OBD ) + " / " + QString::number( nrofDTCs_CC );
	nrofsupportedDTCs_label->setText( dtcstr );
	// Display number of supported measuring blocks / switches:
	int nrofMBs = ssmp_defs.MBrawDefs().size();
	int nrofSWs = ssmp_defs.SWrawDefs().size();
	QString mbswstr = QString::number( nrofMBs ) + " / " + QString::number( nrofSWs );
	nrofsupportedMBsSWs_label->setText( mbswstr );
	// Display number of supported Adjustment values:
	int ecu_adjustments = 0;
	int tcu_adjustments = 0;
	QStringList adjustmentdefs = ssmp_defs.AdjustmentRawDefs();
	for (int k=0; k< adjustmentdefs.size(); k++)
	{
		if (adjustmentdefs.at(k).section(';', 1, 1).toInt() == 0)
		{
			ecu_adjustments++;
		}
		else if (adjustmentdefs.at(k).section(';', 1, 1).toInt() == 1)
		{
			tcu_adjustments++;
		}
	}
	QString adjustmentsstr = QString::number( ecu_adjustments ) + " / " + QString::number( tcu_adjustments );
	nrofadjustmentvalues_label->setText( adjustmentsstr );
	// Display number of supported system tests:
	int nrofSysTests = ssmp_defs.ActuatorRawDefs().size();
	QString systestsstr = QString::number( nrofSysTests ) + " / 1";
	nrofActuatortests_label->setText(systestsstr);
	// Display supported program languages:
	QString langstr;
	for (int k=0; k<__supportedLocales.size(); k++)
	{
		QLocale locale = __supportedLocales.at(k);
		QString langname = QLocale::languageToString( locale.language() );
		QString langname_tr = QCoreApplication::translate( "Language", langname.toUtf8() );
		if (k > 0)
			langstr.append(", ");
		langstr.append(langname_tr);
	}
	languages_label->setText( langstr );
	// Connect buttons:
	connect( showlicense_pushButton, SIGNAL( released() ), this, SLOT( showLicense() ) );
	connect( close_pushButton, SIGNAL( released() ), this, SLOT( close() ) );
}
Пример #12
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tMediaBarPopup::tMediaBarPopup( bool showVirtualHead, QWidget* pParent )
    :   QWidget( pParent ),
        m_Scanning( false ),
        m_pRewindButtonHoldTimer( 0 ),
        m_pFastForwardButtonHoldTimer( 0 ),
        m_pPlayPauseKey( 0 ),
        m_pCloseKey( 0 )
{
    setWindowFlags( windowFlags() | Qt::Popup | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint );
    m_pEventLoop = new QEventLoop( this );

    m_pHBoxLayout = new QHBoxLayout( this );
    m_pHBoxLayout->setContentsMargins( 10, 10, 10, 10 );    

    m_pRewindButtonHoldTimer = new QTimer( this );
    m_pRewindButtonHoldTimer->setInterval( 500 );
    m_pRewindButtonHoldTimer->setSingleShot( true );
    Connect( m_pRewindButtonHoldTimer, SIGNAL( timeout() ), this, SLOT( OnRewindHoldButtonTimerFire() ) );    

    m_pFastForwardButtonHoldTimer = new QTimer( this );
    m_pFastForwardButtonHoldTimer->setInterval( 500 );
    m_pFastForwardButtonHoldTimer->setSingleShot( true );
    Connect( m_pFastForwardButtonHoldTimer, SIGNAL( timeout() ), this, SLOT( OnFastForwardButtonTimerFire() ) );

    /*
        Note the difference between pressed() and clicked().
        pressed() is emitted on a mousePressEvent.
        clicked() is emitted on a mouseReleaseEvent.
    */

    m_pVirtualHeadKey = new tMediaBarPopupKey( false, this );
    m_pVirtualHeadKey->installEventFilter( this );
    m_pVirtualHeadKey->setIcon( QIcon( tPath::ResourceFile( "simrad/audio/mb_virtualhead32.png" ) ) );
    Connect( m_pVirtualHeadKey, SIGNAL( clicked() ), this, SIGNAL( VirtualHeadButtonClicked() ) );

    m_pRewindKey = new tMediaBarPopupKey( true, this );    
    m_pRewindKey->installEventFilter( this );
    m_pRewindKey->setIcon( QIcon( tPath::ResourceFile( "simrad/audio/mb_rwnd32.png" ) ) );
    Connect( m_pRewindKey, SIGNAL( pressed() ), this, SLOT( OnRewindButtonPressed() ) );
    Connect( m_pRewindKey, SIGNAL( clicked() ), this, SLOT( OnRewindButtonClicked() ) );

    m_pFastForwardKey = new tMediaBarPopupKey( true, this );
    m_pFastForwardKey->installEventFilter( this );
    m_pFastForwardKey->setIcon( QIcon( tPath::ResourceFile( "simrad/audio/mb_ffwd32.png" ) ) );
    Connect( m_pFastForwardKey, SIGNAL( pressed() ), this, SLOT( OnFastForwardButtonPressed() ) );
    Connect( m_pFastForwardKey, SIGNAL( clicked() ), this, SLOT( OnFastForwardButtonClicked() ) );

    m_pPlayPauseKey = new tMediaBarPopupKey( true, this );
    m_pPlayPauseKey->installEventFilter( this );
    Connect( m_pPlayPauseKey, SIGNAL( clicked() ), this, SIGNAL( PlayPauseButtonClicked() ) );

    if( !showVirtualHead )
    {
        m_pVirtualHeadKey->hide();
    }
    m_pHBoxLayout->addWidget( m_pVirtualHeadKey, 0, Qt::AlignCenter );
    m_pHBoxLayout->addWidget( m_pRewindKey, 0, Qt::AlignCenter );
    m_pHBoxLayout->addWidget( m_pPlayPauseKey, 0, Qt::AlignCenter );
    m_pHBoxLayout->addWidget( m_pFastForwardKey, 0, Qt::AlignCenter );

    if ( tProductSettings::Instance().ProductSupportsTouch() )
    {
        m_pCloseKey = new tMediaBarPopupKey( true, this );
        m_pCloseKey->setEnabled( true );
        m_pCloseKey->installEventFilter( this );
        m_pCloseKey->setText( "X" );
        Connect( m_pCloseKey, SIGNAL( clicked() ), this, SLOT( close() ) );

        m_pHBoxLayout->addWidget( m_pCloseKey, 0, Qt::AlignCenter );
    }
}
Пример #13
0
EditStyle::EditStyle(Score* s, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      cs     = s;

      buttonApplyToAllParts = buttonBox->addButton(tr("Apply to all Parts"), QDialogButtonBox::ApplyRole);
      buttonApplyToAllParts->setEnabled(cs->parentScore() != nullptr);

      lstyle = *s->style();
      setModal(true);

      chordDescriptionFileButton->setIcon(*icons[int(Icons::fileOpen_ICON)]);

      pageList->setCurrentRow(0);

      //articulationTable->verticalHeader()->setVisible(false); // can get disabled in ui file
      articulationTable->setSelectionBehavior(QAbstractItemView::SelectRows);
      QStringList headers;
      headers << tr("Symbol") << tr("Anchor");
      articulationTable->setHorizontalHeaderLabels(headers);
      articulationTable->setColumnWidth(0, 200);
      articulationTable->setColumnWidth(1, 180);
      articulationTable->setRowCount(int(ArticulationType::ARTICULATIONS));

      accidentalsGroup->setVisible(false); // disable, not yet implemented

      musicalSymbolFont->clear();
      int idx = 0;
      for (auto i : ScoreFont::scoreFonts()) {
            musicalSymbolFont->addItem(i.name(), idx);
            ++idx;
            }

      for (int i = 0; i < int(ArticulationType::ARTICULATIONS); ++i) {
            ArticulationInfo* ai = &Articulation::articulationList[i];

            QPixmap ct = cs->scoreFont()->sym2pixmap(ai->upSym, 3.0);
            QIcon icon(ct);
            QTableWidgetItem* item = new QTableWidgetItem(icon, qApp->translate("articulation", qPrintable(ai->description)));

            item->setFlags(item->flags() & ~Qt::ItemIsEditable);
            articulationTable->setItem(i, 0, item);

            QComboBox* cb = new QComboBox();
            cb->addItem(tr("Above Staff"), int(ArticulationAnchor::TOP_STAFF));
            cb->addItem(tr("Below Staff"), int(ArticulationAnchor::BOTTOM_STAFF));
            cb->addItem(tr("Chord Automatic"), int(ArticulationAnchor::CHORD));
            cb->addItem(tr("Above Chord"), int(ArticulationAnchor::TOP_CHORD));
            cb->addItem(tr("Below Chord"), int(ArticulationAnchor::BOTTOM_CHORD));
            articulationTable->setCellWidget(i, 1, cb);
            }
      QButtonGroup* bg = new QButtonGroup(this);
      bg->addButton(editEvenHeaderL, 0);
      bg->addButton(editEvenHeaderC, 1);
      bg->addButton(editEvenHeaderR, 2);
      bg->addButton(editOddHeaderL,  3);
      bg->addButton(editOddHeaderC,  4);
      bg->addButton(editOddHeaderR,  5);

      bg->addButton(editEvenFooterL, 6);
      bg->addButton(editEvenFooterC, 7);
      bg->addButton(editEvenFooterR, 8);
      bg->addButton(editOddFooterL,  9);
      bg->addButton(editOddFooterC, 10);
      bg->addButton(editOddFooterR, 11);

      // figured bass init
      QList<QString> fbFontNames = FiguredBass::fontNames();
      foreach(const QString& family, fbFontNames)
            comboFBFont->addItem(family);
      comboFBFont->setCurrentIndex(0);
      connect(comboFBFont, SIGNAL(currentIndexChanged(int)), SLOT(on_comboFBFont_currentIndexChanged(int)));

      setValues();

      // keep in sync with implementation in Page::replaceTextMacros (page.cpp)
      // jumping thru hoops here to make the job of translators easier, yet have a nice display
      QString toolTipHeaderFooter
            = QString("<html><head></head><body><p><b>")
            + tr("Special symbols in header/footer")
            + QString("</b></p>")
            + QString("<table><tr><td>$p</td><td>-</td><td><i>")
            + tr("page number, except on first page")
            + QString("</i></td></tr><tr><td>$P</td><td>-</td><td><i>")
            + tr("page number, on all pages")
            + QString("</i></td></tr><tr><td>$n</td><td>-</td><td><i>")
            + tr("number of pages")
            + QString("</i></td></tr><tr><td>$f</td><td>-</td><td><i>")
            + tr("file name")
            + QString("</i></td></tr><tr><td>$F</td><td>-</td><td><i>")
            + tr("file path+name")
            + QString("</i></td></tr><tr><td>$d</td><td>-</td><td><i>")
            + tr("current date")
            + QString("</i></td></tr><tr><td>$D</td><td>-</td><td><i>")
            + tr("creation date")
            + QString("</i></td></tr><tr><td>$C</td><td>-</td><td><i>")
            + tr("copyright, on first page only")
            + QString("</i></td></tr><tr><td>$c</td><td>-</td><td><i>")
            + tr("copyright, on all pages")
            + QString("</i></td></tr><tr><td>$$</td><td>-</td><td><i>")
            + tr("the $ sign itself")
            + QString("</i></td></tr><tr><td>$:tag:</td><td>-</td><td><i>")
            + tr("meta data tag")
            + QString("</i></td></tr></table><p>")
            + tr("Available tags and their current values:")
            + QString("</p><table>");
      // shown all tags for curent score, see also Score::init()
      QMapIterator<QString, QString> i(cs->metaTags());
      while (i.hasNext()) {
            i.next();
            toolTipHeaderFooter += QString("<tr><td>%1</td><td>-</td><td>%2</td></tr>").arg(i.key()).arg(i.value());
      }
      toolTipHeaderFooter += QString("</table></body></html>");
      showHeader->setToolTip(toolTipHeaderFooter);
      showFooter->setToolTip(toolTipHeaderFooter);
      connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonClicked(QAbstractButton*)));
      connect(headerOddEven, SIGNAL(toggled(bool)), SLOT(toggleHeaderOddEven(bool)));
      connect(footerOddEven, SIGNAL(toggled(bool)), SLOT(toggleFooterOddEven(bool)));
      connect(chordDescriptionFileButton, SIGNAL(clicked()), SLOT(selectChordDescriptionFile()));
      connect(chordsStandard, SIGNAL(toggled(bool)), SLOT(setChordStyle(bool)));
      connect(chordsJazz, SIGNAL(toggled(bool)), SLOT(setChordStyle(bool)));
      connect(chordsCustom, SIGNAL(toggled(bool)), SLOT(setChordStyle(bool)));
      connect(SwingOff, SIGNAL(toggled(bool)), SLOT(setSwingParams(bool)));
      connect(swingEighth, SIGNAL(toggled(bool)), SLOT(setSwingParams(bool)));
      connect(swingSixteenth, SIGNAL(toggled(bool)), SLOT(setSwingParams(bool)));
      connect(hideEmptyStaves, SIGNAL(clicked(bool)), dontHideStavesInFirstSystem, SLOT(setEnabled(bool)));

      connect(bg, SIGNAL(buttonClicked(int)), SLOT(editTextClicked(int)));

      QSignalMapper* mapper = new QSignalMapper(this);

#define CR(W, ID) connect(W, SIGNAL(clicked()), mapper, SLOT(map())); mapper->setMapping(W, int(ID));
      CR(resetVoltaY,                StyleIdx::voltaY);
      CR(resetVoltaHook,             StyleIdx::voltaHook);
      CR(resetVoltaLineWidth,        StyleIdx::voltaLineWidth);
      CR(resetVoltaLineStyle,        StyleIdx::voltaLineStyle);

      CR(resetOttavaY,               StyleIdx::ottavaY);
      CR(resetOttavaHook,            StyleIdx::ottavaHook);
      CR(resetOttavaLineWidth,       StyleIdx::ottavaLineWidth);
      CR(resetOttavaLineStyle,       StyleIdx::ottavaLineStyle);
      CR(resetOttavaNumbersOnly,     StyleIdx::ottavaNumbersOnly);

      CR(resetHairpinY,              StyleIdx::hairpinY);
      CR(resetHairpinLineWidth,      StyleIdx::hairpinLineWidth);
      CR(resetHairpinHeight,         StyleIdx::hairpinHeight);
      CR(resetHairpinContinueHeight, StyleIdx::hairpinContHeight);
#undef CR
      connect(mapper, SIGNAL(mapped(int)), SLOT(resetStyleValue(int)));

      }
Пример #14
0
void PYHistogramTip::initSettings()
{
    setAttribute(Qt::WA_TranslucentBackground);
    setWindowFlags(Qt::FramelessWindowHint);
}
Пример #15
0
void AjustesSensores::inicializar(){
    ui->setupUi(this);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
Пример #16
0
TradePadWidget::TradePadWidget(QWidget *parent) : QWidget(parent)
{
    //iniFileString = QDir::currentPath() + "/workspace.ini";
    //wsSettings = new QSettings(iniFileString, QSettings::IniFormat);

    setWindowFlags(Qt::Window);
    setWindowTitle("TradePad");

    pLabelSymbol = new QLabel("Symbol");

    pBtnBid = new QPushButton("12.32");
    pBtnAsk = new QPushButton("12.34");
    pLabelBidSz = new QLabel("150");
    pLabelAskSz = new QLabel("132");

    pLabelSymbol->setStyleSheet("background-color: #000033;"
                               "font: 18pt;"
                               "border: 1px solid #808080;"
                               "border-radius: 5px;"
                               "qproperty-alignment: AlignCenter;");

    pBtnBid->setStyleSheet("background-color: #006666;"
                             "font: 24pt;"
                             "border: 1px solid #010000;"
                             "border-radius: 5px;"
                             "qproperty-alignment: AlignCenter;");

    pLabelBidSz->setStyleSheet("background-color: #006666;"
                               "font: 16pt;"
                               "border: 1px solid #010000;"
                               "border-radius: 5px;"
                               "qproperty-alignment: AlignCenter;");

    pBtnAsk->setStyleSheet("background-color: #400000;"
                             "font: 24pt;"
                             "border: 1px solid #500000;"
                             "border-radius: 5px;"
                             "qproperty-alignment: AlignCenter;");

    pLabelAskSz->setStyleSheet("background-color: #400000;"
                               "font: 16pt;"
                               "border: 1px solid #500000;"
                               "border-radius: 5px;"
                               "qproperty-alignment: AlignCenter;");


    pComboAction = new QComboBox();
    pComboAction->addItem("BUY");
    pComboAction->addItem("SELL");

    pComboOrderType = new QComboBox();
    pComboOrderType->addItem("LMT");
    pComboOrderType->addItem("MKT");

    QLabel *pLabelQty = new QLabel("Qty:");
    pEditQty = new QLineEdit();


    QLabel *pLabelPrice = new QLabel("Price:");
    pEditPrice = new QLineEdit();

    //QWidget* spacer = new QWidget();
    pBtnSubmit = new QPushButton("BUY");
    pBtnSubmit->setStyleSheet("background-color:#006666;font: 18pt;");
    pBtnSubmit->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);


    QGridLayout *gridLayout = new QGridLayout;

    gridLayout->addWidget(pLabelSymbol,0,0,1,2);

    gridLayout->addWidget(pBtnAsk,1,0,1,1);
    gridLayout->addWidget(pLabelAskSz,1,1,1,1);

    gridLayout->addWidget(pBtnBid,2,0,1,1);
    gridLayout->addWidget(pLabelBidSz,2,1,1,1);

    gridLayout->addWidget(pComboAction,3,0,1,1);
    gridLayout->addWidget(pComboOrderType,3,1,1,1);

    gridLayout->addWidget(pLabelQty,4,0,1,1);
    gridLayout->addWidget(pEditQty,4,1,1,1);

    gridLayout->addWidget(pLabelPrice,5,0,1,1);
    gridLayout->addWidget(pEditPrice,5,1,1,1);

    gridLayout->addWidget(pBtnSubmit,6,0,1,2);
    setLayout(gridLayout);

    setMinimumSize(200, 200);

    connect(pComboAction, SIGNAL(currentIndexChanged(QString)), this, SLOT(onActionChanged(QString)));
    connect(pComboOrderType, SIGNAL(currentIndexChanged(QString)), this, SLOT(onOrderTypeChanged(QString)));
    connect(pBtnBid, SIGNAL(clicked(bool)), this, SLOT(onBtnBidClicked(bool)));
    connect(pBtnAsk, SIGNAL(clicked(bool)), this, SLOT(onBtnAskClicked(bool)));
    connect(pBtnSubmit, SIGNAL(clicked(bool)),this, SLOT(onSubmit(bool)));
}
Пример #17
0
LoopLibraryDialog::LoopLibraryDialog(QWidget * parent)
  : QDialog(parent)
{
  setObjectName("GrayWidget");

  setFixedSize(280,584);

  setWindowTitle("Add HVAC System");
  setWindowFlags(Qt::WindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::WindowCloseButtonHint));

  auto mainVLayout = new QVBoxLayout();
  mainVLayout->setContentsMargins(0,0,0,0);
  mainVLayout->setSpacing(0);
  setLayout(mainVLayout);

  QLabel * loopsLabel = new QLabel("HVAC Systems");
  loopsLabel->setStyleSheet("QLabel { margin-left: 5px; }");
  mainVLayout->addSpacing(5);
  mainVLayout->addWidget(loopsLabel);
  mainVLayout->addSpacing(5);

  auto divider = new QFrame();
  divider->setFrameShape(QFrame::HLine);
  divider->setFrameShadow(QFrame::Sunken);
  mainVLayout->addWidget(divider);

  auto scrollAreaWidget = new QWidget();
  scrollAreaWidget->setContentsMargins(0,0,0,0);
  scrollAreaWidget->setObjectName("GrayWidget");

  auto scrollAreaLayout = new QVBoxLayout();
  scrollAreaLayout->setContentsMargins(0,0,0,0);
  scrollAreaLayout->setSpacing(0);
  scrollAreaLayout->setAlignment(Qt::AlignTop);

  scrollAreaWidget->setLayout(scrollAreaLayout);

  m_scrollArea = new QScrollArea();
  m_scrollArea->setFrameStyle(QFrame::NoFrame);
  m_scrollArea->setWidget(scrollAreaWidget);
  m_scrollArea->setWidgetResizable(true);
  m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

  mainVLayout->addWidget(m_scrollArea,100);

  mainVLayout->addStretch();

  //newItem( ADDTOMODEL_SYSTEM_TYPE_1,
  //         QString("Packaged Terminal \nAir Conditioner"),
  //         QPixmap(":/images/system_type_1.png") );

  //newItem( ADDTOMODEL_SYSTEM_TYPE_2,
  //         QString("Packaged Terminal Heat Pump"),
  //         QPixmap(":/images/system_type_2.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_3,
           QString("Packaged Rooftop Unit"),
           QPixmap(":/images/system_type_3.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_4,
           QString("Packaged Rooftop Heat Pump"),
           QPixmap(":/images/system_type_4.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_5,
           QString("Packaged DX Rooftop VAV \nwith Reheat"),
           QPixmap(":/images/system_type_5.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_6,
           QString("Packaged Rooftop \nVAV with Parallel Fan \nPower Boxes and reheat"),
           QPixmap(":/images/system_type_6.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_7,
           QString("Packaged Rooftop \nVAV with Reheat"),
           QPixmap(":/images/system_type_7.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_8,
           QString("VAV with Parallel Fan-Powered \nBoxes and Reheat"),
           QPixmap(":/images/system_type_8.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_9,
           QString("Warm Air Furnace \nGas Fired"),
           QPixmap(":/images/system_type_9.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_10,
           QString("Warm Air Furnace \nElectric"),
           QPixmap(":/images/system_type_10.png") );

  newItem( ADDTOMODEL_AIRLOOPHVAC,
           QString("Empty Air Loop"),
           QPixmap(":/images/air_loop_icon.png") );

  newItem( ADDTOMODEL_PLANTLOOP,
           QString("Empty Plant Loop"),
           QPixmap(":/images/plant_loop_icon.png") );
}
Пример #18
0
FeedbackDialog::FeedbackDialog(QWidget * parent) : QDialog(parent)
{
    setModal(true);
    setWindowFlags(Qt::Sheet);
    setWindowModality(Qt::WindowModal);
    setMinimumSize(700, 460);
    resize(700, 460);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    netManager = NULL;
    GenerateSpecs();

    /* Top layout */

    QVBoxLayout * pageLayout = new QVBoxLayout();
    QHBoxLayout * summaryLayout = new QHBoxLayout();
    QHBoxLayout * emailLayout = new QHBoxLayout();
    QHBoxLayout * descriptionLayout = new QHBoxLayout();
    QHBoxLayout * combinedTopLayout = new QHBoxLayout();
    QHBoxLayout * systemLayout = new QHBoxLayout();

    info = new QLabel();
    info->setText(QString(
        "<style type=\"text/css\">"
        "a { color: #fc0; }"
        "b { color: #0df; }"
        "</style>"
        "<div align=\"center\"><h1>%1</h1>"
        "<h3>%2<h3>"
        "<h4>%3 <a href=\"http://code.google.com/p/hedgewars/wiki/KnownBugs\">known bugs</a><h4>"
        "<h4>%4<h4>"
        "</div>")
        .arg(tr("Send us feedback!"))
        .arg(tr("We are always happy about suggestions, ideas, or bug reports."))
        .arg(tr("If you found a bug, you can see if it's already been reported here: "))
        .arg(tr("Your email address is optional, but necessary if you want us to get back at you."))
    );
    info->setOpenExternalLinks(true);
    pageLayout->addWidget(info);

    QVBoxLayout * summaryEmailLayout = new QVBoxLayout();

    const int labelWidth = 90;

    label_email = new QLabel();
    label_email->setText(QLabel::tr("Your Email"));
    label_email->setFixedWidth(labelWidth);
    emailLayout->addWidget(label_email);
    email = new QLineEdit();
    emailLayout->addWidget(email);
    summaryEmailLayout->addLayout(emailLayout);

    label_summary = new QLabel();
    label_summary->setText(QLabel::tr("Summary"));
    label_summary->setFixedWidth(labelWidth);
    summaryLayout->addWidget(label_summary);
    summary = new QLineEdit();
    summaryLayout->addWidget(summary);
    summaryEmailLayout->addLayout(summaryLayout);

    combinedTopLayout->addLayout(summaryEmailLayout);

    CheckSendSpecs = new QCheckBox();
    CheckSendSpecs->setText(QLabel::tr("Send system information"));
    CheckSendSpecs->setChecked(true);
    systemLayout->addWidget(CheckSendSpecs);
    BtnViewInfo = new QPushButton(tr("View"));
    systemLayout->addWidget(BtnViewInfo, 1);
    BtnViewInfo->setFixedSize(60, 30);
    connect(BtnViewInfo, SIGNAL(clicked()), this, SLOT(ShowSpecs()));
    combinedTopLayout->addLayout(systemLayout);

    combinedTopLayout->setStretch(0, 1);
    combinedTopLayout->insertSpacing(1, 20);

    pageLayout->addLayout(combinedTopLayout);

    label_description = new QLabel();
    label_description->setText(QLabel::tr("Description"));
    label_description->setFixedWidth(labelWidth);
    descriptionLayout->addWidget(label_description, 0, Qt::AlignTop);
    description = new QTextBrowser();
    description->setReadOnly(false);
    descriptionLayout->addWidget(description);
    pageLayout->addLayout(descriptionLayout);

    /* Bottom layout */

    QHBoxLayout * bottomLayout = new QHBoxLayout();
    QHBoxLayout * captchaLayout = new QHBoxLayout();
    QVBoxLayout * captchaInputLayout = new QVBoxLayout();

    QPushButton * BtnCancel = new QPushButton(tr("Cancel"));
    bottomLayout->addWidget(BtnCancel, 0);
    BtnCancel->setFixedSize(100, 40);
    connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject()));

    bottomLayout->insertStretch(1);

    label_captcha = new QLabel();
    label_captcha->setStyleSheet("border: 3px solid #ffcc00; border-radius: 4px");
    label_captcha->setText("loading<br>captcha");
    label_captcha->setFixedSize(200, 50);
    captchaLayout->addWidget(label_captcha);

    label_captcha_input = new QLabel();
    label_captcha_input->setText(QLabel::tr("Type the security code:"));
    captchaInputLayout->addWidget(label_captcha_input);
    captchaInputLayout->setAlignment(label_captcha, Qt::AlignBottom);
    captcha_code = new QLineEdit();
    captcha_code->setFixedSize(165, 30);
    captchaInputLayout->addWidget(captcha_code);
    captchaInputLayout->setAlignment(captcha_code, Qt::AlignTop);
    captchaLayout->addLayout(captchaInputLayout);
    captchaLayout->setAlignment(captchaInputLayout, Qt::AlignLeft);

    bottomLayout->addLayout(captchaLayout);
    bottomLayout->addSpacing(40);

    // TODO: Set green arrow icon for send button (:/res/Start.png)
    BtnSend = new QPushButton(tr("Send Feedback"));
    bottomLayout->addWidget(BtnSend, 0);
    BtnSend->setFixedSize(120, 40);
    connect(BtnSend, SIGNAL(clicked()), this, SLOT(SendFeedback()));

    bottomLayout->setStretchFactor(captchaLayout, 0);
    bottomLayout->setStretchFactor(BtnSend, 1);

    QVBoxLayout * dialogLayout = new QVBoxLayout(this);
    dialogLayout->addLayout(pageLayout, 1);
    dialogLayout->addLayout(bottomLayout);

    LoadCaptchaImage();
}
Пример #19
0
    /**
    * @brief Constructs dialog with specified connection
    */
    CreateConnectionDialog::CreateConnectionDialog(ConnectionsDialog* parent)
        : QDialog(), _connectionsDialog(parent), _connection(nullptr), _fromURI(true),   // todo: _fromURI:false
        _mongoUriWithStatus(nullptr)
    {
        setWindowTitle("Create New Connection");
        setWindowIcon(GuiRegistry::instance().serverIcon());
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
        setMinimumWidth(450);
        //setAttribute(Qt::WA_DeleteOnClose);

        // Splitter-Left
        auto label01 = new QLabel("Replica Set");
        label01->setStyleSheet("font-weight: bold");
        auto wid1 = new QLabel;
        auto repSetImage = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\repset.png");
        wid1->setPixmap(repSetImage);
        
        _uriLineEdit = new QLineEdit("mongodb://localhost:27017,localhost:27018,localhost:27019/admin?replicaSet=repset");

        auto const& createConnStr= QString("b) <a style='color: %1' href='create'>Create connection manually</a>").arg("#106CD6");
        auto createConnLabel = new QLabel(createConnStr);
        VERIFY(connect(createConnLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_createConnLinkActivated())));

        auto splitterL = new QSplitter;
        splitterL->setOrientation(Qt::Vertical);
        splitterL->addWidget(label01);
        splitterL->addWidget(wid1);
        //splitterL->addWidget(new QLabel(""));
        //splitterL->addWidget(nameWid);
        splitterL->addWidget(new QLabel(""));
        splitterL->addWidget(new QLabel("a) I have a URI connection string:"));
        splitterL->addWidget(_uriLineEdit);
        splitterL->addWidget(new QLabel(""));
        splitterL->addWidget(createConnLabel);
        splitterL->addWidget(new QLabel(""));


        // Splitter-Right
        auto label2 = new QLabel("Stand Alone Server");
        label2->setStyleSheet("font-weight: bold");
        auto wid2 = new QLabel;
        auto standAlone = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\stand_alone.png");
        wid2->setPixmap(standAlone);

        auto splitterR = new QSplitter;
        splitterR->setOrientation(Qt::Vertical);
        splitterR->addWidget(label2);
        splitterR->addWidget(wid2);

        // Splitter layout
        auto splitterLay = new QHBoxLayout;
        splitterLay->addWidget(splitterL);
        //splitterLay->addWidget(splitterR);

        // Button Box
        QPushButton *testButton = new QPushButton("&Test");
        testButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
        VERIFY(connect(testButton, SIGNAL(clicked()), this, SLOT(testConnection())));

        QHBoxLayout *bottomLayout = new QHBoxLayout;
        bottomLayout->addWidget(testButton, 1, Qt::AlignLeft);
        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        buttonBox->button(QDialogButtonBox::Save)->setText("Next");
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
        bottomLayout->addWidget(buttonBox);

        // main layout
        auto mainLayout = new QVBoxLayout;
        mainLayout->addLayout(splitterLay);
        mainLayout->addLayout(bottomLayout);
        setLayout(mainLayout);

        //_basicTab->setFocus();
        adjustSize();

        // Set minimum width - adjustment after adding SSLTab
        setMinimumWidth(550);
    }
Пример #20
0
SettingsPageUnits::SettingsPageUnits(QWidget *parent) : QWidget(parent)
{
  setObjectName("SettingsPageUnits");
  setWindowFlags( Qt::Tool );
  setWindowModality( Qt::WindowModal );
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle( tr("Settings - Units") );

  if( parent )
    {
      resize( parent->size() );
    }

  // Layout used by scroll area
  QHBoxLayout *sal = new QHBoxLayout;

  // new widget used as container for the dialog layout.
  QWidget* sw = new QWidget;

  // Scroll area
  QScrollArea* sa = new QScrollArea;
  sa->setWidgetResizable( true );
  sa->setFrameStyle( QFrame::NoFrame );
  sa->setWidget( sw );

#ifdef ANDROID
  QScrollBar* lvsb = sa->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture( sa->viewport(), QScroller::LeftMouseButtonGesture );
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture( sa->viewport(), QtScroller::LeftMouseButtonGesture );
#endif

  // Add scroll area to its own layout
  sal->addWidget( sa );

  QHBoxLayout *contentLayout = new QHBoxLayout;
  setLayout(contentLayout);

  // Pass scroll area layout to the content layout.
  contentLayout->addLayout( sal, 10 );

  // The parent of the layout is the scroll widget
  QGridLayout *topLayout = new QGridLayout(sw);

  int row=0;

  QLabel *label = new QLabel(tr("Altitude:"), this);
  topLayout->addWidget(label, row, 0);
  UnitAlt = new QComboBox(this);
  UnitAlt->setObjectName("UnitAlt");
  UnitAlt->setEditable(false);
  topLayout->addWidget(UnitAlt,row++,1);
  UnitAlt->addItem(tr("meters"));
  UnitAlt->addItem(tr("feet"));
  altitudes[0] = int(Altitude::meters);
  altitudes[1] = int(Altitude::feet);

  label = new QLabel(tr("Speed:"), this);
  topLayout->addWidget(label, row, 0);
  UnitSpeed = new QComboBox(this);
  UnitSpeed->setObjectName("UnitSpeed");
  UnitSpeed->setEditable(false);
  topLayout->addWidget(UnitSpeed,row++,1);
  UnitSpeed->addItem(tr("meters per second"));
  UnitSpeed->addItem(tr("kilometers per hour"));
  UnitSpeed->addItem(tr("knots"));
  UnitSpeed->addItem(tr("miles per hour"));
  speeds[0] = Speed::metersPerSecond;
  speeds[1] = Speed::kilometersPerHour;
  speeds[2] = Speed::knots;
  speeds[3] = Speed::milesPerHour;

  label = new QLabel(tr("Distance:"), this);
  topLayout->addWidget(label, row, 0);
  UnitDistance = new QComboBox(this);
  UnitDistance->setObjectName("UnitDistance");
  UnitDistance->setEditable(false);
  topLayout->addWidget(UnitDistance,row++,1);
  UnitDistance->addItem(tr("kilometers"));
  UnitDistance->addItem(tr("statute miles"));
  UnitDistance->addItem(tr("nautical miles"));
  distances[0] = Distance::kilometers;
  distances[1] = Distance::miles;
  distances[2] = Distance::nautmiles;

  label = new QLabel(tr("Vario:"), this);
  topLayout->addWidget(label, row, 0);
  UnitVario = new QComboBox(this);
  UnitVario->setObjectName("UnitVario");
  UnitVario->setEditable(false);
  topLayout->addWidget(UnitVario,row++,1);
  UnitVario->addItem(tr("meters per second"));
  UnitVario->addItem(tr("feet per minute"));
  UnitVario->addItem(tr("knots"));
  varios[0] = Speed::metersPerSecond;
  varios[1] = Speed::feetPerMinute;
  varios[2] = Speed::knots;

  label = new QLabel(tr("Wind:"), this);
  topLayout->addWidget(label, row, 0);
  UnitWind = new QComboBox(this);
  UnitWind->setObjectName("UnitWind");
  UnitWind->setEditable(false);
  topLayout->addWidget(UnitWind,row++,1);
  UnitWind->addItem(tr("meters per second"));
  UnitWind->addItem(tr("kilometers per hour"));
  UnitWind->addItem(tr("knots"));
  UnitWind->addItem(tr("miles per hour"));
  winds[0] = Speed::metersPerSecond;
  winds[1] = Speed::kilometersPerHour;
  winds[2] = Speed::knots;
  winds[3] = Speed::milesPerHour;

  label = new QLabel(tr("Position:"), this);
  topLayout->addWidget(label, row, 0);
  UnitPosition = new QComboBox(this);
  UnitPosition->setObjectName("UnitPosition");
  UnitPosition->setEditable(false);
  topLayout->addWidget(UnitPosition,row++,1);
  UnitPosition->addItem(QString("ddd") + Qt::Key_degree + "mm'ss\"");
  UnitPosition->addItem(QString("ddd") + Qt::Key_degree + "mm.mmm'");
  UnitPosition->addItem(QString("ddd.ddddd") + Qt::Key_degree);
  positions[0] = WGSPoint::DMS;
  positions[1] = WGSPoint::DDM;
  positions[2] = WGSPoint::DDD;

  label = new QLabel(tr("Time:"), this);
  topLayout->addWidget(label, row, 0);
  UnitTime = new QComboBox(this);
  UnitTime->setObjectName("UnitTime");
  UnitTime->setEditable(false);
  topLayout->addWidget(UnitTime,row++,1);
  UnitTime->addItem(tr("UTC"));
  UnitTime->addItem(tr("Local"));
  times[0] = Time::utc;
  times[1] = Time::local;

  label = new QLabel(tr("Temperature:"), this);
  topLayout->addWidget(label, row, 0);
  UnitTemperature = new QComboBox(this);
  UnitTemperature->setObjectName("UnitTemperature");
  UnitTemperature->setEditable(false);
  topLayout->addWidget(UnitTemperature,row++,1);
  UnitTemperature->addItem(tr("Celsius"));
  UnitTemperature->addItem(tr("Fahrenheit"));
  temperature[0] = GeneralConfig::Celsius;
  temperature[1] = GeneralConfig::Fahrenheit;

  label = new QLabel(tr("Air Pressure:"), this);
  topLayout->addWidget(label, row, 0);
  UnitAirPressure = new QComboBox(this);
  UnitAirPressure->setObjectName("UnitAirPressure");
  UnitAirPressure->setEditable(false);
  topLayout->addWidget(UnitAirPressure,row++,1);
  UnitAirPressure->addItem(tr("hPa"));
  UnitAirPressure->addItem(tr("inHg"));
  airPressure[0] = GeneralConfig::hPa;
  airPressure[1] = GeneralConfig::inHg;

  topLayout->setRowStretch(row++, 10);
  topLayout->setColumnStretch(2, 10);

  QPushButton *help = new QPushButton(this);
  help->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("help32.png")));
  help->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  help->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QPushButton *cancel = new QPushButton(this);
  cancel->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("cancel.png")));
  cancel->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  cancel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QPushButton *ok = new QPushButton(this);
  ok->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("ok.png")));
  ok->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  ok->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QLabel *titlePix = new QLabel(this);
  titlePix->setAlignment( Qt::AlignCenter );
  titlePix->setPixmap(GeneralConfig::instance()->loadPixmap("setup.png"));

  connect(help, SIGNAL(pressed()), this, SLOT(slotHelp()));
  connect(ok, SIGNAL(pressed()), this, SLOT(slotAccept()));
  connect(cancel, SIGNAL(pressed()), this, SLOT(slotReject()));

  QVBoxLayout *buttonBox = new QVBoxLayout;
  buttonBox->setSpacing(0);
  buttonBox->addWidget(help, 1);
  buttonBox->addStretch(2);
  buttonBox->addWidget(cancel, 1);
  buttonBox->addSpacing(30);
  buttonBox->addWidget(ok, 1);
  buttonBox->addStretch(2);
  buttonBox->addWidget(titlePix);
  contentLayout->addLayout(buttonBox);

  load();
}
Пример #21
0
void RecWindow::CreateLayout(QWidget *parent)
{
    //Default
    imgout = NULL;
    thread_cam_active = false;
    doAnalysis = false;
	capture = NULL;
    surface = new QLabel();
    main_layout = new QVBoxLayout;
    Main_Widget = new QWidget;

    slider1_layout = new QHBoxLayout;
    slider1_label = new QLabel("value = 0");
    slider1 = new QSlider(Qt::Horizontal);
    slider1->setMaximum(40);
    slider1_layout->addWidget(slider1_label);
    slider1_layout->addWidget(slider1);

    slider2_layout = new QHBoxLayout;
    slider2_label = new QLabel("value = 0");
    slider2 = new QSlider(Qt::Horizontal);
    slider2->setMaximum(1000);
    slider2_layout->addWidget(slider2_label);
    slider2_layout->addWidget(slider2);

    info_layout = new QVBoxLayout;
    info_fps = new QLabel("FPS = 0");
    info_frameNum = new QLabel("Frame = 0");
    info_time = new QLabel("Time : 0");
    info_layout->addWidget(info_fps);
    info_layout->addWidget(info_frameNum);
    info_layout->addWidget(info_time);

    surface_layout = new QHBoxLayout;
    surface_layout->addLayout(info_layout);
    surface_layout->addWidget(surface);

    //Button
    button_layout = new QHBoxLayout;
    rec_btn = new QPushButton("Record");
    save_btn = new QPushButton("Save");
    analysis_btn = new QPushButton("Analysis");
    button_layout->addWidget(rec_btn);
    button_layout->addWidget(save_btn);
    button_layout->addWidget(analysis_btn);
    //Options
    surface2_layout = new QVBoxLayout;
    option_layout = new QHBoxLayout;
    chkbox_layout = new QHBoxLayout;
    surface2_layout->addLayout(option_layout);
    //Start making layout
    main_layout->addLayout(slider1_layout);
    main_layout->addLayout(slider2_layout);
    main_layout->addLayout(surface2_layout);
    main_layout->addLayout(surface_layout);
    main_layout->addLayout(button_layout);
    //Side object
    //file_name = "/home/bijan/Downloads/IMG_20140630_213804.jpg";
    filter_param = trmMark::Loadparam("settings.json");
    NA_image = cvLoadImage("../Resources/NA.jpg");
    //default
    treshold_1 = 0;
    treshold_2 = 0;
    surface_width = filter_param.calibre_width;

    //Window
    setLayout(main_layout);
    setWindowTitle(trUtf8("Capture Vide"));
    //setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::Window);
    //setSizePolicy(QSizePolicy::Minimum);
    //setLayoutDirection(Qt::RightToLeft);
}
Пример #22
0
VolumeListingDialog::VolumeListingDialog(QWidget* parent, SelectionMode selectionMode)
    : QWidget(parent)
    , selectionMode_(selectionMode)
    , reader_(0)
{
    setWindowFlags(Qt::Dialog);
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Volume Selection"));

    // table configuration
    table_ = new QTableWidget();
    table_->setSelectionBehavior(QAbstractItemView::SelectRows);
    table_->setSelectionMode(selectionMode == SINGLE_SELECTION ? QAbstractItemView::SingleSelection : QAbstractItemView::MultiSelection);
    table_->setSortingEnabled(true);
    table_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    // top label
    QVBoxLayout* mainLayout = new QVBoxLayout();
    titleLabel_ = new QLabel(tr("The selected file contains multiple volumes. Please select the volumes to load:"));
    QFont labelFont = titleLabel_->font();
    labelFont.setPointSize(titleLabel_->font().pointSize()+1);
    labelFont.setBold(true);
    titleLabel_->setFont(labelFont);
    mainLayout->addWidget(titleLabel_);

    // filter bar
    QHBoxLayout* searchLayout = new QHBoxLayout();
    filterLabel_ = new QLabel(tr("Filter: "));
    searchLayout->addWidget(filterLabel_);
    filterTextBox_ = new QLineEdit();
    searchLayout->addWidget(filterTextBox_);
    comboBoxFilterAttribute_ = new QComboBox();
    comboBoxFilterAttribute_->setMinimumWidth(100);
    searchLayout->addWidget(comboBoxFilterAttribute_);
    mainLayout->addLayout(searchLayout);

    // table
    mainLayout->addWidget(table_);

    // buttons
    QHBoxLayout* buttonLayout = new QHBoxLayout();
    buttonLayout->addStretch();
    cancelButton_ = new QPushButton(tr("Cancel"));
    cancelButton_->setFixedWidth(100);
    buttonLayout->addWidget(cancelButton_);
    if (selectionMode_ == MULTI_SELECTION) {
        selectAllButton_ = new QPushButton(tr("Select All"));
        selectAllButton_->setFixedWidth(100);
        buttonLayout->addWidget(selectAllButton_);
    }
    else
        selectAllButton_ = 0;
    loadButton_ = new QPushButton(tr("Load"));
    loadButton_->setFixedWidth(100);
    QFont loadFont(loadButton_->font());
    loadFont.setBold(true);
    loadButton_->setFont(loadFont);
    buttonLayout->addWidget(loadButton_);
    mainLayout->addLayout(buttonLayout);

    setLayout(mainLayout);

    connect(table_, SIGNAL(itemSelectionChanged()), this, SLOT(updateGuiState()));
    connect(table_, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellDoubleClicked()));

    connect(filterTextBox_, SIGNAL(textChanged(const QString&)), this, SLOT(updateTableRows()));
    connect(filterTextBox_, SIGNAL(editingFinished()), this, SLOT(updateTableRows()));
    connect(comboBoxFilterAttribute_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTableRows()));

    connect(loadButton_, SIGNAL(clicked()), this, SLOT(loadClicked()));
    if (selectionMode_ == MULTI_SELECTION)
        connect(selectAllButton_, SIGNAL(clicked()), this, SLOT(selectAllClicked()));
    connect(cancelButton_, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    resize(600, 300);
    updateGuiState();
}
Пример #23
0
QT_BEGIN_NAMESPACE

/*!
    \class QDialog
    \brief The QDialog class is the base class of dialog windows.

    \ingroup dialog-classes
    \ingroup abstractwidgets


    A dialog window is a top-level window mostly used for short-term
    tasks and brief communications with the user. QDialogs may be
    modal or modeless. QDialogs can
    provide a \link #return return
    value\endlink, and they can have \link #default default
    buttons\endlink. QDialogs can also have a QSizeGrip in their
    lower-right corner, using setSizeGripEnabled().

    Note that QDialog (an any other widget that has type Qt::Dialog) uses
    the parent widget slightly differently from other classes in Qt. A
    dialog is always a top-level widget, but if it has a parent, its
    default location is centered on top of the parent's top-level widget
    (if it is not top-level itself). It will also share the parent's
    taskbar entry.

    Use the overload of the QWidget::setParent() function to change
    the ownership of a QDialog widget. This function allows you to
    explicitly set the window flags of the reparented widget; using
    the overloaded function will clear the window flags specifying the
    window-system properties for the widget (in particular it will
    reset the Qt::Dialog flag).

    \section1 Modal Dialogs

    A \bold{modal} dialog is a dialog that blocks input to other
    visible windows in the same application. Dialogs that are used to
    request a file name from the user or that are used to set
    application preferences are usually modal. Dialogs can be
    \l{Qt::ApplicationModal}{application modal} (the default) or
    \l{Qt::WindowModal}{window modal}.

    When an application modal dialog is opened, the user must finish
    interacting with the dialog and close it before they can access
    any other window in the application. Window modal dialogs only
    block access to the window associated with the dialog, allowing
    the user to continue to use other windows in an application.

    The most common way to display a modal dialog is to call its
    exec() function. When the user closes the dialog, exec() will
    provide a useful \link #return return value\endlink. Typically,
    to get the dialog to close and return the appropriate value, we
    connect a default button, e.g. \gui OK, to the accept() slot and a
    \gui Cancel button to the reject() slot.
    Alternatively you can call the done() slot with \c Accepted or
    \c Rejected.

    An alternative is to call setModal(true) or setWindowModality(),
    then show(). Unlike exec(), show() returns control to the caller
    immediately. Calling setModal(true) is especially useful for
    progress dialogs, where the user must have the ability to interact
    with the dialog, e.g.  to cancel a long running operation. If you
    use show() and setModal(true) together to perform a long operation,
    you must call QApplication::processEvents() periodically during
    processing to enable the user to interact with the dialog. (See
    QProgressDialog.)

    \section1 Modeless Dialogs

    A \bold{modeless} dialog is a dialog that operates
    independently of other windows in the same application. Find and
    replace dialogs in word-processors are often modeless to allow the
    user to interact with both the application's main window and with
    the dialog.

    Modeless dialogs are displayed using show(), which returns control
    to the caller immediately.

    If you invoke the \l{QWidget::show()}{show()} function after hiding
    a dialog, the dialog will be displayed in its original position. This is
    because the window manager decides the position for windows that
    have not been explicitly placed by the programmer. To preserve the
    position of a dialog that has been moved by the user, save its position
    in your \l{QWidget::closeEvent()}{closeEvent()}  handler and then
    move the dialog to that position, before showing it again.

    \target default
    \section1 Default Button

    A dialog's \e default button is the button that's pressed when the
    user presses Enter (Return). This button is used to signify that
    the user accepts the dialog's settings and wants to close the
    dialog. Use QPushButton::setDefault(), QPushButton::isDefault()
    and QPushButton::autoDefault() to set and control the dialog's
    default button.

    \target escapekey
    \section1 Escape Key

    If the user presses the Esc key in a dialog, QDialog::reject()
    will be called. This will cause the window to close: The \link
    QCloseEvent close event \endlink cannot be \link
    QCloseEvent::ignore() ignored \endlink.

    \section1 Extensibility

    Extensibility is the ability to show the dialog in two ways: a
    partial dialog that shows the most commonly used options, and a
    full dialog that shows all the options. Typically an extensible
    dialog will initially appear as a partial dialog, but with a
    \gui More toggle button. If the user presses the \gui More button down,
    the dialog is expanded. The \l{Extension Example} shows how to achieve
    extensible dialogs using Qt.

    \target return
    \section1 Return Value (Modal Dialogs)

    Modal dialogs are often used in situations where a return value is
    required, e.g. to indicate whether the user pressed \gui OK or
    \gui Cancel. A dialog can be closed by calling the accept() or the
    reject() slots, and exec() will return \c Accepted or \c Rejected
    as appropriate. The exec() call returns the result of the dialog.
    The result is also available from result() if the dialog has not
    been destroyed.

    In order to modify your dialog's close behavior, you can reimplement
    the functions accept(), reject() or done(). The
    \l{QWidget::closeEvent()}{closeEvent()} function should only be
    reimplemented to preserve the dialog's position or to override the
    standard close or reject behavior.

    \target examples
    \section1 Code Examples

    A modal dialog:

    \snippet doc/src/snippets/dialogs/dialogs.cpp 1

    A modeless dialog:

    \snippet doc/src/snippets/dialogs/dialogs.cpp 0

    \sa QDialogButtonBox, QTabWidget, QWidget, QProgressDialog,
        {fowler}{GUI Design Handbook: Dialogs, Standard}, {Extension Example},
        {Standard Dialogs Example}
*/

/*! \enum QDialog::DialogCode

    The value returned by a modal dialog.

    \value Accepted
    \value Rejected
*/

/*!
  \property QDialog::sizeGripEnabled
  \brief whether the size grip is enabled

  A QSizeGrip is placed in the bottom-right corner of the dialog when this
  property is enabled. By default, the size grip is disabled.
*/


/*!
  Constructs a dialog with parent \a parent.

  A dialog is always a top-level widget, but if it has a parent, its
  default location is centered on top of the parent. It will also
  share the parent's taskbar entry.

  The widget flags \a f are passed on to the QWidget constructor.
  If, for example, you don't want a What's This button in the title bar
  of the dialog, pass Qt::WindowTitleHint | Qt::WindowSystemMenuHint in \a f.

  \sa QWidget::setWindowFlags()
*/

QDialog::QDialog(QWidget *parent, Qt::WindowFlags f)
    : QWidget(*new QDialogPrivate, parent,
              f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0)))
{
#ifdef Q_WS_WINCE
    if (!qt_wince_is_smartphone())
        setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
#endif

#ifdef Q_WS_S60
    if (S60->avkonComponentsSupportTransparency) {
        bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
        setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
        setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
    }
#endif
}
Пример #24
0
B9Terminal::B9Terminal(QWidget *parent, Qt::WindowFlags flags) :
    QWidget(parent, flags),
    ui(new Ui::B9Terminal)
{
    setWindowFlags(Qt::WindowContextHelpButtonHint);
    m_bWaiverPresented = false;
    m_bWaiverAccepted = false;
    m_bWavierActive = false;
    m_bNeedsWarned = true;
    m_iFillLevel = -1;

    ui->setupUi(this);
    ui->commStatus->setText("Searching for B9Creator...");

    qDebug() << "Terminal Start";

    m_pCatalog = new B9MatCat;
    onBC_ModelInfo("B9C1");

    pSettings = new PCycleSettings;
    resetLastSentCycleSettings();

    // 始终设置B9PrinterComm在此终端构造器
    pPrinterComm = new B9PrinterComm;
    pPrinterComm->enableBlankCloning(true); // 允许对固件更新疑似“空白”B9Creator的Arduino的主板

    // 始终设置B9PrinterComm在此终端构造器
    m_pDesktop = QApplication::desktop();
    pProjector = NULL;
    m_bPrimaryScreen = false;
    m_bPrintPreview = false;
    m_bUsePrimaryMonitor = false;

    connect(m_pDesktop, SIGNAL(screenCountChanged(int)),this, SLOT(onScreenCountChanged(int)));

    connect(pPrinterComm,SIGNAL(updateConnectionStatus(QString)), this, SLOT(onUpdateConnectionStatus(QString)));
    connect(pPrinterComm,SIGNAL(BC_ConnectionStatusDetailed(QString)), this, SLOT(onBC_ConnectionStatusDetailed(QString)));
    connect(pPrinterComm,SIGNAL(BC_LostCOMM()),this,SLOT(onBC_LostCOMM()));

    connect(pPrinterComm,SIGNAL(BC_RawData(QString)), this, SLOT(onUpdateRAWPrinterComm(QString)));
    connect(pPrinterComm,SIGNAL(BC_Comment(QString)), this, SLOT(onUpdatePrinterComm(QString)));

    connect(pPrinterComm,SIGNAL(BC_ModelInfo(QString)),this,SLOT(onBC_ModelInfo(QString)));
    connect(pPrinterComm,SIGNAL(BC_FirmVersion(QString)),this,SLOT(onBC_FirmVersion(QString)));
    connect(pPrinterComm,SIGNAL(BC_ProjectorRemoteCapable(bool)), this, SLOT(onBC_ProjectorRemoteCapable(bool)));
    connect(pPrinterComm,SIGNAL(BC_HasShutter(bool)), this, SLOT(onBC_HasShutter(bool)));
    connect(pPrinterComm,SIGNAL(BC_ProjectorStatusChanged()), this, SLOT(onBC_ProjStatusChanged()));
    connect(pPrinterComm,SIGNAL(BC_ProjectorFAIL()), this, SLOT(onBC_ProjStatusFAIL()));

    // Z轴位置控制
    connect(pPrinterComm, SIGNAL(BC_PU(int)), this, SLOT(onBC_PU(int)));
    connect(pPrinterComm, SIGNAL(BC_UpperZLimPU(int)), this, SLOT(onBC_UpperZLimPU(int)));
    m_pResetTimer = new QTimer(this);
    connect(m_pResetTimer, SIGNAL(timeout()), this, SLOT(onMotionResetTimeout()));
    connect(pPrinterComm, SIGNAL(BC_HomeFound()), this, SLOT(onMotionResetComplete()));
    connect(pPrinterComm, SIGNAL(BC_CurrentZPosInPU(int)), this, SLOT(onBC_CurrentZPosInPU(int)));
    connect(pPrinterComm, SIGNAL(BC_HalfLife(int)), this, SLOT(onBC_HalfLife(int)));
    connect(pPrinterComm, SIGNAL(BC_NativeX(int)), this, SLOT(onBC_NativeX(int)));
    connect(pPrinterComm, SIGNAL(BC_NativeY(int)), this, SLOT(onBC_NativeY(int)));
    connect(pPrinterComm, SIGNAL(BC_XYPixelSize(int)), this, SLOT(onBC_XYPixelSize(int)));


    m_pVatTimer = new QTimer(this);
    connect(m_pVatTimer, SIGNAL(timeout()), this, SLOT(onMotionVatTimeout()));
    connect(pPrinterComm, SIGNAL(BC_CurrentVatPercentOpen(int)), this, SLOT(onBC_CurrentVatPercentOpen(int)));

    m_pPReleaseCycleTimer = new QTimer(this);
    connect(m_pPReleaseCycleTimer, SIGNAL(timeout()), this, SLOT(onReleaseCycleTimeout()));
    connect(pPrinterComm, SIGNAL(BC_PrintReleaseCycleFinished()), this, SLOT(onBC_PrintReleaseCycleFinished()));

    onScreenCountChanged(0);
}
Пример #25
0
TableProperties::TableProperties(QMainWindow *parent, QString table_name, QStringList table_names_list, bool oid, QString inherits, QString tablespce, int fill_factr)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setModal(true);
    setParent(parent);
    setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
    setWindowModality(Qt::WindowModal);

    QFont title_font("Helvetica [Cronyx]", 14, QFont::Bold);
    QFont font("Helvetica [Cronyx]");

    title = new QLabel(this);
    title->setAlignment(Qt::AlignHCenter);
    title->setText(tr("Properties"));
    title->setFont(title_font);

    with_oid = new QCheckBox(this);
    with_oid->setChecked(oid);

    /*inherit_like = new QComboBox(this);
    inherit_like->setFont(font);
    inherit_like->addItem("Inherits");
    inherit_like->addItem("Like");*/

    parent_table = new QLineEdit(this);
    parent_table->setText(inherits);
    parent_table->setFont(font);

    completer = new QCompleter(table_names_list, this);

    parent_table->setCompleter(completer);

    tablespace = new QLineEdit(this);
    tablespace->setText(tablespce);
    tablespace->setFont(font);

    fill_factor = new QSpinBox(this);
    fill_factor->setMinimum(10);
    fill_factor->setMaximum(100);
    fill_factor->setSuffix("%");
    fill_factor->setValue(fill_factr);
    fill_factor->setFont(font);

    button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    button_box->setCenterButtons(true);
    button_box->setFont(font);
    connect(button_box, SIGNAL(accepted()), this, SLOT(okslot()));
    connect(button_box, SIGNAL(rejected()), this, SLOT(close()));

    form_layout = new QFormLayout;
    form_layout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    form_layout->setContentsMargins(20,10,20,10);
    form_layout->setVerticalSpacing(20);
    form_layout->addRow(title);
    form_layout->addRow(tr("With oids"), with_oid);
    form_layout->labelForField(with_oid)->setFont(font);
    form_layout->addRow(QLatin1String("Inherits"), parent_table);
    form_layout->labelForField(parent_table)->setFont(font);
    form_layout->addRow(tr("Tablespace"), tablespace);
    form_layout->labelForField(tablespace)->setFont(font);
    form_layout->addRow(tr("Fill factor"), fill_factor);
    form_layout->labelForField(fill_factor)->setFont(font);
    form_layout->addRow(button_box);
    setLayout(form_layout);

#ifdef Q_WS_X11
    move(parent->x()+parent->width()/2-sizeHint().width()/2, parent->y()+parent->height()/2-sizeHint().height()/2);
#endif
}
Пример #26
0
ContextMenu::ContextMenu(QWidget *parent) :
    ClickableWidget(parent),
    ui(new Ui::ContextMenu)
{
    ui->setupUi(this);
    setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus);
    setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true);
    setAttribute(Qt::WA_TranslucentBackground, true);
    setAttribute(Qt::WA_NoMousePropagation, true);
    this->hide();

    // -------------------------------------------------------------------------
    // setup actions
    // top zoom buttons
    ui->zoomIn->setAction("zoomIn");
    ui->zoomIn->setTriggerMode(TriggerMode::PressTrigger);
    ui->zoomOut->setAction("zoomOut");
    ui->zoomOut->setTriggerMode(TriggerMode::PressTrigger);
    ui->zoomOriginal->setAction("fitNormal");
    ui->zoomOriginal->setTriggerMode(TriggerMode::PressTrigger);
    ui->fitWidth->setAction("fitWidth");
    ui->fitWidth->setTriggerMode(TriggerMode::PressTrigger);
    ui->fitWindow->setAction("fitWindow");
    ui->fitWindow->setTriggerMode(TriggerMode::PressTrigger);
    // -------------------------------------------------------------------------
    //  entries
    ui->rotateLeft->setAction("rotateLeft");
    ui->rotateLeft->setText("Rotate left");
    ui->rotateLeft->setIcon(QIcon(":/res/icons/buttons/rotate-left16.png"));

    ui->rotateRight->setAction("rotateRight");
    ui->rotateRight->setText("Rotate right");
    ui->rotateRight->setIcon(QIcon(":/res/icons/buttons/rotate-right16.png"));

    ui->flipH->setAction("flipH");
    ui->flipH->setText("Flip H");
    ui->flipH->setIcon(QIcon(":/res/icons/buttons/flip-h16.png"));

    ui->flipV->setAction("flipV");
    ui->flipV->setText("Flip V");
    ui->flipV->setIcon(QIcon(":/res/icons/buttons/flip-v16.png"));

    ui->crop->setAction("crop");
    ui->crop->setText("Crop");
    ui->crop->setIcon(QIcon(":/res/icons/buttons/image-crop16.png"));

    ui->resize->setAction("resize");
    ui->resize->setText("Resize");
    ui->resize->setIcon(QIcon(":/res/icons/buttons/view-fullscreen16.png"));
    // -------------------------------------------------------------------------
    ui->copy->setAction("copyFile");
    ui->copy->setText("Quick copy");
    ui->copy->setIcon(QIcon(":/res/icons/buttons/copy16.png"));

    ui->move->setAction("moveFile");
    ui->move->setText("Quick move");
    ui->move->setIcon(QIcon(":/res/icons/buttons/move16.png"));

    ui->trash->setAction("moveToTrash");
    ui->trash->setText("Move to trash");
    ui->trash->setIcon(QIcon(":/res/icons/buttons/trash-red16.png"));
    // -------------------------------------------------------------------------
    ui->open->setAction("open");
    ui->open->setText("Open");
    ui->open->setIcon(QIcon(":/res/icons/buttons/open16.png"));

    ui->folderView->setAction("folderView");
    ui->folderView->setText("Folder View");
    ui->folderView->setIcon(QIcon(":/res/icons/buttons/folderview16.png"));

    ui->settings->setAction("openSettings");
    ui->settings->setText("Settings");
    ui->settings->setIcon(QIcon(":/res/icons/buttons/settings16.png"));
    // -------------------------------------------------------------------------
    connect(this, SIGNAL(pressed()), this, SLOT(hide()));
}
Пример #27
0
    DocumentTextEditor::DocumentTextEditor(const CollectionInfo &info, const QString &json, bool readonly /* = false */, QWidget *parent) :
        QDialog(parent),
        _info(info),
        _readonly(readonly)
    {
        QRect screenGeometry = QApplication::desktop()->availableGeometry();
        int horizontalMargin = (int)(screenGeometry.width() * 0.35);
        int verticalMargin = (int)(screenGeometry.height() * 0.20);
        QSize size(screenGeometry.width() - horizontalMargin,
                   screenGeometry.height() - verticalMargin);

        QSettings settings("Paralect", "Robomongo");
        if (settings.contains("DocumentTextEditor/size"))
        {
            restoreWindowSettings();
        }
        else
        {
            resize(size);
        }

        setWindowFlags(Qt::Window | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);

        Indicator *collectionIndicator = new Indicator(GuiRegistry::instance().collectionIcon(), QtUtils::toQString(_info._ns.collectionName()));
        Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), QtUtils::toQString(_info._ns.databaseName()));
        Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), QtUtils::toQString(detail::prepareServerAddress(_info._serverAddress)));

        QPushButton *validate = new QPushButton("Validate");
        validate->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
        VERIFY(connect(validate, SIGNAL(clicked()), this, SLOT(onValidateButtonClicked())));

        _queryText = new FindFrame(this);
        _configureQueryText();
        _queryText->sciScintilla()->setText(json);
        // clear modification state after setting the content
        _queryText->sciScintilla()->setModified(false);

        VERIFY(connect(_queryText->sciScintilla(), SIGNAL(textChanged()), this, SLOT(onQueryTextChanged())));

        QHBoxLayout *hlayout = new QHBoxLayout();
        hlayout->setContentsMargins(2, 0, 5, 1);
        hlayout->setSpacing(0);
        hlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
        hlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
        hlayout->addWidget(collectionIndicator, 0, Qt::AlignLeft);
        hlayout->addStretch(1);

        QDialogButtonBox *buttonBox = new QDialogButtonBox (this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));

        QHBoxLayout *bottomlayout = new QHBoxLayout();
        bottomlayout->addWidget(validate);
        bottomlayout->addStretch(1);
        bottomlayout->addWidget(buttonBox);

        QVBoxLayout *layout = new QVBoxLayout();

        // show top bar only if we have info for it
        if (_info.isValid())
            layout->addLayout(hlayout);

        layout->addWidget(_queryText);
        layout->addLayout(bottomlayout);
        setLayout(layout);

        if (_readonly) {
            validate->hide();
            buttonBox->button(QDialogButtonBox::Save)->hide();
            _queryText->sciScintilla()->setReadOnly(true);
        }
    }
Пример #28
0
NBaseMiniAppWidget::NBaseMiniAppWidget(NBaseMoveableWidget *parent) : NBaseMoveableWidget(parent)
{
    setWindowFlags( Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint|Qt::Tool );
    setAttribute(Qt::WA_TranslucentBackground, true);
    setFocusPolicy(Qt::NoFocus);
}
    // --------------- QDesignerPromotionDialog
    QDesignerPromotionDialog::QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
                                                       QWidget *parent,
                                                       const QString &promotableWidgetClassName,
                                                       QString *promoteTo) :
        QDialog(parent),
        m_mode(promotableWidgetClassName.isEmpty() || promoteTo == 0 ? ModeEdit : ModeEditChooseClass),
        m_promotableWidgetClassName(promotableWidgetClassName),
        m_core(core),
        m_promoteTo(promoteTo),
        m_promotion(core->promotion()),
        m_model(new PromotionModel(core)),
        m_treeView(new QTreeView),
        m_buttonBox(0),
        m_removeButton(new QPushButton(createIconSet(QString::fromUtf8("minus.png")), QString()))
    {
        m_buttonBox = createButtonBox();
        setModal(true);
        setWindowTitle(tr("Promoted Widgets"));
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

        QVBoxLayout *vboxLayout = new QVBoxLayout(this);

        // tree view group
        QGroupBox *treeViewGroup = new QGroupBox();
        treeViewGroup->setTitle(tr("Promoted Classes"));
        QVBoxLayout *treeViewVBoxLayout = new QVBoxLayout(treeViewGroup);
        // tree view
        m_treeView->setModel (m_model);
        m_treeView->setMinimumWidth(450);
        m_treeView->setContextMenuPolicy(Qt::CustomContextMenu);

        connect(m_treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
                this, SLOT(slotSelectionChanged(QItemSelection,QItemSelection)));

        connect(m_treeView, SIGNAL(customContextMenuRequested(QPoint)),
                this, SLOT(slotTreeViewContextMenu(QPoint)));

        QHeaderView *headerView = m_treeView->header();
        headerView->setResizeMode(QHeaderView::ResizeToContents);
        treeViewVBoxLayout->addWidget(m_treeView);
        // remove button
        QHBoxLayout *hboxLayout = new QHBoxLayout();
        hboxLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));

        m_removeButton->setAutoDefault(false);
        connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemove()));
        m_removeButton->setEnabled(false);
        hboxLayout->addWidget(m_removeButton);
        treeViewVBoxLayout->addLayout(hboxLayout);
        vboxLayout->addWidget(treeViewGroup);
        // Create new panel: Try to be smart and preselect a base class. Default to QFrame
        const QStringList &baseClassNameList = baseClassNames(m_promotion);
        int preselectedBaseClass = -1;
        if (m_mode == ModeEditChooseClass) {
            preselectedBaseClass = baseClassNameList.indexOf(m_promotableWidgetClassName);
        }
        if (preselectedBaseClass == -1)
            preselectedBaseClass = baseClassNameList.indexOf(QLatin1String("QFrame"));

        NewPromotedClassPanel *newPromotedClassPanel = new NewPromotedClassPanel(baseClassNameList, preselectedBaseClass);
        newPromotedClassPanel->setPromotedHeaderSuffix(core->integration()->headerSuffix());
        newPromotedClassPanel->setPromotedHeaderLowerCase(core->integration()->isHeaderLowercase());
        connect(newPromotedClassPanel, SIGNAL(newPromotedClass(PromotionParameters,bool*)), this, SLOT(slotNewPromotedClass(PromotionParameters,bool*)));
        connect(this, SIGNAL(selectedBaseClassChanged(QString)),
                newPromotedClassPanel, SLOT(chooseBaseClass(QString)));
        vboxLayout->addWidget(newPromotedClassPanel);
        // button box
        vboxLayout->addWidget(m_buttonBox);
        // connect model
        connect(m_model, SIGNAL(includeFileChanged(QDesignerWidgetDataBaseItemInterface*,QString)),
                this, SLOT(slotIncludeFileChanged(QDesignerWidgetDataBaseItemInterface*,QString)));

        connect(m_model, SIGNAL(classNameChanged(QDesignerWidgetDataBaseItemInterface*,QString)),
                this, SLOT(slotClassNameChanged(QDesignerWidgetDataBaseItemInterface*,QString)));

        // focus
        if (m_mode == ModeEditChooseClass)
            newPromotedClassPanel->grabFocus();

        slotUpdateFromWidgetDatabase();
    }
Пример #30
0
//---------------------------------------------------------------------------
// Constructor
Help::Help(QWidget * parent)
: QDialog(parent)
{
    move(QApplication::desktop()->screenGeometry().width()/5, y());
    resize(QApplication::desktop()->screenGeometry().width()-QApplication::desktop()->screenGeometry().width()/5*2, QApplication::desktop()->screenGeometry().height()*3/4);

    setWindowFlags(windowFlags()&(0xFFFFFFFF-Qt::WindowContextHelpButtonHint));
    setWindowTitle("QCTools help");

    Close=new QPushButton("&Close");
    Close->setDefault(true);
    QDialogButtonBox* Dialog=new QDialogButtonBox();
    Dialog->addButton(Close, QDialogButtonBox::AcceptRole);
    connect(Dialog, SIGNAL(accepted()), this, SLOT(close()));

    QVBoxLayout* L=new QVBoxLayout();
    Central=new QTabWidget(this);
    QTextBrowser* Text1=new QTextBrowser(this);
    Text1->setReadOnly(true);
    Text1->setOpenExternalLinks(true);
    Text1->setSource(QUrl("qrc:/Help/Getting Started/Getting Started.html"));
    Central->addTab(Text1, tr("Getting Started"));

    QTextBrowser* Text2=new QTextBrowser(this);
    Text2->setReadOnly(true);
    Text2->setOpenExternalLinks(true);
    Text2->setSource(QUrl("qrc:/Help/How To Use/How To Use.html"));
    Central->addTab(Text2, tr("How To Use"));

    QTextBrowser* Text3=new QTextBrowser(this);
    Text3->setReadOnly(true);
    Text3->setOpenExternalLinks(true);
    Text3->setSource(QUrl("qrc:/Help/Filter Descriptions/Filter Descriptions.html"));
    Central->addTab(Text3, tr("Filter Descriptions"));

    QTextBrowser* Text4=new QTextBrowser(this);
    Text4->setReadOnly(true);
    Text4->setOpenExternalLinks(true);
    Text4->setSource(QUrl("qrc:/Help/Playback Filters/Playback Filters.html"));
    Central->addTab(Text4, tr("Playback Filters"));

    QTextBrowser* Text5=new QTextBrowser(this);
    Text5->setReadOnly(true);
    Text5->setOpenExternalLinks(true);
    Text5->setSource(QUrl("qrc:/Help/Data Format/Data Format.html"));
    Central->addTab(Text5, tr("Data Format"));

    QTextBrowser* Text6=new QTextBrowser(this);
    Text6->setReadOnly(true);
    Text6->setOpenExternalLinks(true);
    Text6->setSource(QUrl("qrc:/Help/Recording/Recording.html"));
    Central->addTab(Text6, tr("Recording"));

    QTextBrowser* Text7=new QTextBrowser(this);
    Text7->setReadOnly(true);
    Text7->setOpenExternalLinks(true);
    Text7->setSource(QUrl("qrc:/Help/About.html"));
    Central->addTab(Text7, tr("About"));

    L->addWidget(Central);
    L->addWidget(Close);
    setLayout(L);
}