Changeset 5354a01311 in tspsg for src/mainwindow.cpp


Ignore:
Timestamp:
Jun 15, 2009, 5:10:25 PM (15 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
5fce561905
Parents:
bcfd415fe2
Message:

+ Windows CE (WM6, actually, but should work on other versions) support:

  • added optimized for wince forms (recommended minimal resolution is 240x320);
  • removed unsupported under wince features from menus (e.g., printing);
  • added preprocessor directives to remove code for unsupported under wince features.
  • Fixed wrong encoding in some files to UTF-8.
  • Updated copyright and e-mail.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    rbcfd415fe2 r5354a01311  
    11/*
    22 *  TSPSG - TSP Solver and Generator
    3  *  Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>
     3 *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
    44 *
    55 *  $Id$
     
    2323
    2424#include <QtGui>
     25#ifndef Q_OS_WINCE
     26        #include <QPrintDialog>
     27#endif // Q_OS_WINCE
    2528#include "mainwindow.h"
    2629
     
    3235        setupUi(this);
    3336        connect(actionSettingsSettings,SIGNAL(triggered()),this,SLOT(ChangeSettings()));
     37#ifndef Q_OS_WINCE
     38        connect(actionFilePrintSetup,SIGNAL(triggered()),this,SLOT(PrintSetup()));
     39#endif // Q_OS_WINCE
    3440        connect(buttonSolve,SIGNAL(clicked()),this,SLOT(Solve()));
    3541        connect(buttonRandom,SIGNAL(clicked()),this,SLOT(Random()));
    3642        connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(CitiesNumberChanged(int)));
     43QRect rect = geometry();
     44#ifdef Q_OS_WINCE
     45        // HACK: Fix for all tabWidget elements becoming "unclickable" if making it central widget.
     46        rect.setSize(QApplication::desktop()->availableGeometry().size());
     47        rect.setHeight(rect.height() - (QApplication::desktop()->screenGeometry().height() - QApplication::desktop()->availableGeometry().height()));
     48        tabWidget->resize(rect.width(),rect.height() - toolBar->size().height());
     49#else
    3750        // Centering MainWindow
    3851        // TODO: Loading of saved window state
    39 QRect rect = geometry();
    40         rect.moveCenter(QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen()).center());
     52        rect.moveCenter(QApplication::desktop()->availableGeometry().center());
     53#endif // Q_OS_WINCE
    4154        setGeometry(rect);
    4255        qsrand(QDateTime().currentDateTime().toTime_t());
     
    6376        }
    6477}
     78
     79#ifndef Q_OS_WINCE
     80void MainWindow::PrintSetup()
     81{
     82QPrintDialog pd;
     83        pd.exec();
     84}
     85#endif // Q_OS_WINCE
    6586
    6687void MainWindow::Random()
     
    93114        // tabWidget->setCurrentIndex(1);
    94115}
    95 
Note: See TracChangeset for help on using the changeset viewer.